From 67c1556599db8b9e9910a55200de444d68ae234ec1c44e5ecc88e7fb45b1defe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Tue, 8 Feb 2022 01:03:50 +0000 Subject: [PATCH] Accepting request 952130 from home:StefanBruens:branches:science - Run unittests manually, to make test failures visible between noisy output - Bump version - Pre-generate parsetab.py for ply.yacc in OpenSCAD and FEM Mods: https://tracker.freecadweb.org/view.php?id=4840 OBS-URL: https://build.opensuse.org/request/show/952130 OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=142 --- FreeCAD-test.changes | 7 +++++++ FreeCAD-test.spec | 33 ++++++++++++++++++++++++++------- FreeCAD.changes | 6 ++++++ FreeCAD.spec | 21 +++++++++++++++++++++ 4 files changed, 60 insertions(+), 7 deletions(-) diff --git a/FreeCAD-test.changes b/FreeCAD-test.changes index 96ba29e..a3862e8 100644 --- a/FreeCAD-test.changes +++ b/FreeCAD-test.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun Feb 6 17:33:16 UTC 2022 - Stefan Brüns + +- Run unittests manually, to make test failures visible between + noisy output +- Bump version + ------------------------------------------------------------------- Wed May 6 07:02:41 UTC 2020 - Wolfgang Bauer diff --git a/FreeCAD-test.spec b/FreeCAD-test.spec index b074abe..3df8d71 100644 --- a/FreeCAD-test.spec +++ b/FreeCAD-test.spec @@ -17,13 +17,13 @@ Name: FreeCAD-test -Version: 0.19.0 +Version: 0.19.3 Release: 0 Summary: Meta source package that runs the FreeCAD testsuite when built License: GPL-2.0-or-later AND LGPL-2.0-or-later Group: Productivity/Graphics/CAD URL: http://www.freecadweb.org/ -BuildRequires: FreeCAD +BuildRequires: FreeCAD = %{version} %if 0%{?suse_version} > 1500 BuildRequires: gmsh %endif @@ -36,10 +36,29 @@ This is just executing the test suite at build time. %build export LC_ALL="C.utf-8" -file=`mktemp` -if ! FreeCAD --console --write-log --log-file="$file" --run-test 0; then - cat "$file" - exit 1 -fi +export PYTHONPATH=%{_libdir}/FreeCAD/lib +python3 -c "\ +import FreeCAD +import unittest +print(FreeCAD.__unit_test__) +results = {} +for name in FreeCAD.__unit_test__: + suite = unittest.TestSuite() + suite.addTest(unittest.defaultTestLoader.loadTestsFromName(name)) + print(\"Running: {}\".format(name), file=sys.stderr) + r = unittest.TextTestRunner() + res = r.run(suite) + results[name] = res + +totalerrors = 0 +totalfailures = 0 +for [name,res] in results.items(): + print(name) + print(res) + totalerrors += len(res.errors) + totalfailures += len(res.failures) + +exit((totalerrors + totalfailures) > 0) +" %changelog diff --git a/FreeCAD.changes b/FreeCAD.changes index 07a5905..ce30281 100644 --- a/FreeCAD.changes +++ b/FreeCAD.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Feb 6 17:31:23 UTC 2022 - Stefan Brüns + +- Pre-generate parsetab.py for ply.yacc in OpenSCAD and FEM Mods: + https://tracker.freecadweb.org/view.php?id=4840 + ------------------------------------------------------------------- Fri Jan 14 17:27:24 UTC 2022 - Stefan Brüns diff --git a/FreeCAD.spec b/FreeCAD.spec index 5912d28..f919cf7 100644 --- a/FreeCAD.spec +++ b/FreeCAD.spec @@ -80,6 +80,7 @@ BuildRequires: sqlite3-devel # Qt5 & python3 BuildRequires: python3-devel BuildRequires: python3-matplotlib +BuildRequires: python3-ply BuildRequires: python3-pybind11-devel BuildRequires: python3-pycxx-devel BuildRequires: python3-pyside2-devel @@ -204,6 +205,26 @@ rm src/3rdparty/Pivy-0.5 -fr %install %cmake_install +# create parsetab.py for yacc.ply (FEM) +# https://tracker.freecadweb.org/view.php?id=4840 +pushd %{buildroot}/%{_libdir}/FreeCAD/Mod/Fem +python3 -B femtools/tokrules.py +rm femtools/parser.out +# create parsetab.py for yacc.ply (OpenSCAD) +export PYTHONPATH=%{buildroot}/%{_libdir}/FreeCAD/lib +export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}/FreeCAD/lib +cd ../OpenSCAD +python3 -B -c "\ +import ply.lex as lex +import ply.yacc as yacc +import importCSG +import tokrules +from tokrules import tokens +lex.lex(module=tokrules) +yacc.yacc(module=importCSG,outputdir=\"./\") +" +rm parser.out + %suse_update_desktop_file -r org.freecadweb.FreeCAD Education Engineering # Remove unneeded files