diff --git a/src/Mod/Fem/App/CMakeLists.txt b/src/Mod/Fem/App/CMakeLists.txt index e590abf760..4e18ff0769 100644 --- a/src/Mod/Fem/App/CMakeLists.txt +++ b/src/Mod/Fem/App/CMakeLists.txt @@ -250,38 +250,43 @@ SET(FemGuiScripts_SRCS ) SET(FemTests_SRCS - test_files/__init__.py - test_files/ccx/__init__.py - test_files/ccx/cube_mesh.py - test_files/ccx/cube_frequency.inp - test_files/ccx/cube_frequency.dat - test_files/ccx/cube_frequency.frd - test_files/ccx/cube_frequency_expected_values - test_files/ccx/cube_static.inp - test_files/ccx/cube_static.dat - test_files/ccx/cube_static.frd - test_files/ccx/cube_static_expected_values - test_files/ccx/cube.fcstd - test_files/ccx/spine_mesh.py - test_files/ccx/spine_thermomech.inp - test_files/ccx/spine_thermomech.dat - test_files/ccx/spine_thermomech.frd - test_files/ccx/spine_thermomech_expected_values - test_files/ccx/spine_thermomech.fcstd - test_files/ccx/Flow1D_mesh.py - test_files/ccx/Flow1D_thermomech.inp - test_files/ccx/Flow1D_thermomech.dat - test_files/ccx/Flow1D_thermomech.frd - test_files/ccx/Flow1D_thermomech_expected_values - test_files/ccx/Flow1D_thermomech_inout_nodes.txt - test_files/ccx/Flow1D_thermomech.fcstd + femtest/__init__.py + femtest/testfemcommon.py +) + +SET(FemTestsCCx_SRCS + femtest/testfiles/__init__.py + femtest/testfiles/ccx/__init__.py + femtest/testfiles/ccx/cube_mesh.py + femtest/testfiles/ccx/cube_frequency.inp + femtest/testfiles/ccx/cube_frequency.dat + femtest/testfiles/ccx/cube_frequency.frd + femtest/testfiles/ccx/cube_frequency_expected_values + femtest/testfiles/ccx/cube_static.inp + femtest/testfiles/ccx/cube_static.dat + femtest/testfiles/ccx/cube_static.frd + femtest/testfiles/ccx/cube_static_expected_values + femtest/testfiles/ccx/cube.fcstd + femtest/testfiles/ccx/spine_mesh.py + femtest/testfiles/ccx/spine_thermomech.inp + femtest/testfiles/ccx/spine_thermomech.dat + femtest/testfiles/ccx/spine_thermomech.frd + femtest/testfiles/ccx/spine_thermomech_expected_values + femtest/testfiles/ccx/spine_thermomech.fcstd + femtest/testfiles/ccx/Flow1D_mesh.py + femtest/testfiles/ccx/Flow1D_thermomech.inp + femtest/testfiles/ccx/Flow1D_thermomech.dat + femtest/testfiles/ccx/Flow1D_thermomech.frd + femtest/testfiles/ccx/Flow1D_thermomech_expected_values + femtest/testfiles/ccx/Flow1D_thermomech_inout_nodes.txt + femtest/testfiles/ccx/Flow1D_thermomech.fcstd ) SET(FemTestsElmer_SRCS - test_files/elmer/__init__.py - test_files/elmer/case.sif - test_files/elmer/group_mesh.geo - test_files/elmer/ELMERSOLVER_STARTINFO + femtest/testfiles/elmer/__init__.py + femtest/testfiles/elmer/case.sif + femtest/testfiles/elmer/group_mesh.geo + femtest/testfiles/elmer/ELMERSOLVER_STARTINFO ) SET(FemBase_SRCS @@ -396,6 +401,7 @@ fc_target_copy_resource(Fem ${FemMesh_SRCS} ${FemGuiScripts_SRCS} ${FemTests_SRCS} + ${FemTestsCCx_SRCS} ${FemTestsElmer_SRCS} ${FemSolver_SRCS} ${FemElmer_SRCS} diff --git a/src/Mod/Fem/CMakeLists.txt b/src/Mod/Fem/CMakeLists.txt index ba0c135b0a..41e80ca460 100755 --- a/src/Mod/Fem/CMakeLists.txt +++ b/src/Mod/Fem/CMakeLists.txt @@ -227,50 +227,55 @@ INSTALL( INSTALL( FILES - # changes on the file list here needs to be made in App/CMakeLists.txt as well - test_files/__init__.py + femtest/__init__.py + femtest/testfemcommon.py DESTINATION - Mod/Fem/test_files + Mod/Fem/femtest ) INSTALL( FILES - # changes on the file list here needs to be made in App/CMakeLists.txt as well - test_files/ccx/__init__.py - test_files/ccx/cube_mesh.py - test_files/ccx/cube_frequency.inp - test_files/ccx/cube_frequency.dat - test_files/ccx/cube_frequency.frd - test_files/ccx/cube_frequency_expected_values - test_files/ccx/cube_static.inp - test_files/ccx/cube_static.dat - test_files/ccx/cube_static.frd - test_files/ccx/cube_static_expected_values - test_files/ccx/cube.fcstd - test_files/ccx/spine_mesh.py - test_files/ccx/spine_thermomech.inp - test_files/ccx/spine_thermomech.dat - test_files/ccx/spine_thermomech.frd - test_files/ccx/spine_thermomech_expected_values - test_files/ccx/spine_thermomech.fcstd - test_files/ccx/Flow1D_mesh.py - test_files/ccx/Flow1D_thermomech.inp - test_files/ccx/Flow1D_thermomech.dat - test_files/ccx/Flow1D_thermomech.frd - test_files/ccx/Flow1D_thermomech_expected_values - test_files/ccx/Flow1D_thermomech_inout_nodes.txt - test_files/ccx/Flow1D_thermomech.fcstd + femtest/testfiles/__init__.py DESTINATION - Mod/Fem/test_files/ccx + Mod/Fem/femtest/testfiles ) INSTALL( FILES - # changes on the file list here needs to be made in App/CMakeLists.txt as well - test_files/elmer/__init__.py - test_files/elmer/case.sif - test_files/elmer/group_mesh.geo - test_files/elmer/ELMERSOLVER_STARTINFO + femtest/testfiles/ccx/__init__.py + femtest/testfiles/ccx/cube_mesh.py + femtest/testfiles/ccx/cube_frequency.inp + femtest/testfiles/ccx/cube_frequency.dat + femtest/testfiles/ccx/cube_frequency.frd + femtest/testfiles/ccx/cube_frequency_expected_values + femtest/testfiles/ccx/cube_static.inp + femtest/testfiles/ccx/cube_static.dat + femtest/testfiles/ccx/cube_static.frd + femtest/testfiles/ccx/cube_static_expected_values + femtest/testfiles/ccx/cube.fcstd + femtest/testfiles/ccx/spine_mesh.py + femtest/testfiles/ccx/spine_thermomech.inp + femtest/testfiles/ccx/spine_thermomech.dat + femtest/testfiles/ccx/spine_thermomech.frd + femtest/testfiles/ccx/spine_thermomech_expected_values + femtest/testfiles/ccx/spine_thermomech.fcstd + femtest/testfiles/ccx/Flow1D_mesh.py + femtest/testfiles/ccx/Flow1D_thermomech.inp + femtest/testfiles/ccx/Flow1D_thermomech.dat + femtest/testfiles/ccx/Flow1D_thermomech.frd + femtest/testfiles/ccx/Flow1D_thermomech_expected_values + femtest/testfiles/ccx/Flow1D_thermomech_inout_nodes.txt + femtest/testfiles/ccx/Flow1D_thermomech.fcstd DESTINATION - Mod/Fem/test_files/elmer + Mod/Fem/femtest/testfiles/ccx +) + +INSTALL( + FILES + femtest/testfiles/elmer/__init__.py + femtest/testfiles/elmer/case.sif + femtest/testfiles/elmer/group_mesh.geo + femtest/testfiles/elmer/ELMERSOLVER_STARTINFO + DESTINATION + Mod/Fem/femtest/testfiles/elmer ) diff --git a/src/Mod/Fem/test_files/ccx/Flow1D_thermomech.dat b/src/Mod/Fem/femtest/__init__.py similarity index 100% rename from src/Mod/Fem/test_files/ccx/Flow1D_thermomech.dat rename to src/Mod/Fem/femtest/__init__.py diff --git a/src/Mod/Fem/TestFem.py b/src/Mod/Fem/femtest/testfemcommon.py similarity index 99% rename from src/Mod/Fem/TestFem.py rename to src/Mod/Fem/femtest/testfemcommon.py index 9c29d26e41..e947fa45c2 100644 --- a/src/Mod/Fem/TestFem.py +++ b/src/Mod/Fem/femtest/testfemcommon.py @@ -41,8 +41,8 @@ home_path = FreeCAD.getHomePath() temp_dir = tempfile.gettempdir() + '/FEM_unittests/' if not os.path.exists(temp_dir): os.makedirs(temp_dir) -test_file_dir = home_path + 'Mod/Fem/test_files/ccx/' -test_file_dir_elmer = home_path + 'Mod/Fem/test_files/elmer/' +test_file_dir = home_path + 'Mod/Fem/femtest/testfiles/ccx/' +test_file_dir_elmer = home_path + 'Mod/Fem/femtest/testfiles/elmer/' # define some locations fot the analysis tests # since they are also used in the helper def which create results they should stay global for the module @@ -501,7 +501,8 @@ class FemCcxAnalysisTest(unittest.TestCase): analysis.addObject(pressure_constraint) fcc_print('Checking FEM new mesh...') - from test_files.ccx.cube_mesh import create_nodes_cube, create_elements_cube + from .testfiles.ccx.cube_mesh import create_nodes_cube + from .testfiles.ccx.cube_mesh import create_elements_cube mesh = Fem.FemMesh() ret = create_nodes_cube(mesh) self.assertTrue(ret, "Import of mesh nodes failed") @@ -750,7 +751,8 @@ class FemCcxAnalysisTest(unittest.TestCase): analysis.addObject(heatflux_constraint) fcc_print('Checking FEM new mesh...') - from test_files.ccx.spine_mesh import create_nodes_spine, create_elements_spine + from .testfiles.ccx.spine_mesh import create_nodes_spine + from .testfiles.ccx.spine_mesh import create_elements_spine mesh = Fem.FemMesh() ret = create_nodes_spine(mesh) self.assertTrue(ret, "Import of mesh nodes failed") @@ -997,7 +999,8 @@ class FemCcxAnalysisTest(unittest.TestCase): analysis.addObject(Flow1d_self_weight) fcc_print('Checking FEM new mesh...') - from test_files.ccx.Flow1D_mesh import create_nodes_Flow1D, create_elements_Flow1D + from .testfiles.ccx.Flow1D_mesh import create_nodes_Flow1D + from .testfiles.ccx.Flow1D_mesh import create_elements_Flow1D mesh = Fem.FemMesh() ret = create_nodes_Flow1D(mesh) self.assertTrue(ret, "Import of mesh nodes failed") diff --git a/src/Mod/Fem/test_files/__init__.py b/src/Mod/Fem/femtest/testfiles/__init__.py similarity index 100% rename from src/Mod/Fem/test_files/__init__.py rename to src/Mod/Fem/femtest/testfiles/__init__.py diff --git a/src/Mod/Fem/test_files/ccx/Flow1D_mesh.py b/src/Mod/Fem/femtest/testfiles/ccx/Flow1D_mesh.py similarity index 100% rename from src/Mod/Fem/test_files/ccx/Flow1D_mesh.py rename to src/Mod/Fem/femtest/testfiles/ccx/Flow1D_mesh.py diff --git a/src/Mod/Fem/femtest/testfiles/ccx/Flow1D_thermomech.dat b/src/Mod/Fem/femtest/testfiles/ccx/Flow1D_thermomech.dat new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/Mod/Fem/test_files/ccx/Flow1D_thermomech.fcstd b/src/Mod/Fem/femtest/testfiles/ccx/Flow1D_thermomech.fcstd similarity index 100% rename from src/Mod/Fem/test_files/ccx/Flow1D_thermomech.fcstd rename to src/Mod/Fem/femtest/testfiles/ccx/Flow1D_thermomech.fcstd diff --git a/src/Mod/Fem/test_files/ccx/Flow1D_thermomech.frd b/src/Mod/Fem/femtest/testfiles/ccx/Flow1D_thermomech.frd similarity index 100% rename from src/Mod/Fem/test_files/ccx/Flow1D_thermomech.frd rename to src/Mod/Fem/femtest/testfiles/ccx/Flow1D_thermomech.frd diff --git a/src/Mod/Fem/test_files/ccx/Flow1D_thermomech.inp b/src/Mod/Fem/femtest/testfiles/ccx/Flow1D_thermomech.inp similarity index 100% rename from src/Mod/Fem/test_files/ccx/Flow1D_thermomech.inp rename to src/Mod/Fem/femtest/testfiles/ccx/Flow1D_thermomech.inp diff --git a/src/Mod/Fem/test_files/ccx/Flow1D_thermomech_expected_values b/src/Mod/Fem/femtest/testfiles/ccx/Flow1D_thermomech_expected_values similarity index 100% rename from src/Mod/Fem/test_files/ccx/Flow1D_thermomech_expected_values rename to src/Mod/Fem/femtest/testfiles/ccx/Flow1D_thermomech_expected_values diff --git a/src/Mod/Fem/test_files/ccx/Flow1D_thermomech_inout_nodes.txt b/src/Mod/Fem/femtest/testfiles/ccx/Flow1D_thermomech_inout_nodes.txt similarity index 100% rename from src/Mod/Fem/test_files/ccx/Flow1D_thermomech_inout_nodes.txt rename to src/Mod/Fem/femtest/testfiles/ccx/Flow1D_thermomech_inout_nodes.txt diff --git a/src/Mod/Fem/test_files/ccx/__init__.py b/src/Mod/Fem/femtest/testfiles/ccx/__init__.py similarity index 100% rename from src/Mod/Fem/test_files/ccx/__init__.py rename to src/Mod/Fem/femtest/testfiles/ccx/__init__.py diff --git a/src/Mod/Fem/test_files/ccx/cube.fcstd b/src/Mod/Fem/femtest/testfiles/ccx/cube.fcstd similarity index 100% rename from src/Mod/Fem/test_files/ccx/cube.fcstd rename to src/Mod/Fem/femtest/testfiles/ccx/cube.fcstd diff --git a/src/Mod/Fem/test_files/ccx/cube_frequency.dat b/src/Mod/Fem/femtest/testfiles/ccx/cube_frequency.dat similarity index 100% rename from src/Mod/Fem/test_files/ccx/cube_frequency.dat rename to src/Mod/Fem/femtest/testfiles/ccx/cube_frequency.dat diff --git a/src/Mod/Fem/test_files/ccx/cube_frequency.fcstd b/src/Mod/Fem/femtest/testfiles/ccx/cube_frequency.fcstd similarity index 100% rename from src/Mod/Fem/test_files/ccx/cube_frequency.fcstd rename to src/Mod/Fem/femtest/testfiles/ccx/cube_frequency.fcstd diff --git a/src/Mod/Fem/test_files/ccx/cube_frequency.frd b/src/Mod/Fem/femtest/testfiles/ccx/cube_frequency.frd similarity index 100% rename from src/Mod/Fem/test_files/ccx/cube_frequency.frd rename to src/Mod/Fem/femtest/testfiles/ccx/cube_frequency.frd diff --git a/src/Mod/Fem/test_files/ccx/cube_frequency.inp b/src/Mod/Fem/femtest/testfiles/ccx/cube_frequency.inp similarity index 100% rename from src/Mod/Fem/test_files/ccx/cube_frequency.inp rename to src/Mod/Fem/femtest/testfiles/ccx/cube_frequency.inp diff --git a/src/Mod/Fem/test_files/ccx/cube_frequency_expected_values b/src/Mod/Fem/femtest/testfiles/ccx/cube_frequency_expected_values similarity index 100% rename from src/Mod/Fem/test_files/ccx/cube_frequency_expected_values rename to src/Mod/Fem/femtest/testfiles/ccx/cube_frequency_expected_values diff --git a/src/Mod/Fem/test_files/ccx/cube_mesh.py b/src/Mod/Fem/femtest/testfiles/ccx/cube_mesh.py similarity index 100% rename from src/Mod/Fem/test_files/ccx/cube_mesh.py rename to src/Mod/Fem/femtest/testfiles/ccx/cube_mesh.py diff --git a/src/Mod/Fem/test_files/ccx/cube_static.dat b/src/Mod/Fem/femtest/testfiles/ccx/cube_static.dat similarity index 100% rename from src/Mod/Fem/test_files/ccx/cube_static.dat rename to src/Mod/Fem/femtest/testfiles/ccx/cube_static.dat diff --git a/src/Mod/Fem/test_files/ccx/cube_static.fcstd b/src/Mod/Fem/femtest/testfiles/ccx/cube_static.fcstd similarity index 100% rename from src/Mod/Fem/test_files/ccx/cube_static.fcstd rename to src/Mod/Fem/femtest/testfiles/ccx/cube_static.fcstd diff --git a/src/Mod/Fem/test_files/ccx/cube_static.frd b/src/Mod/Fem/femtest/testfiles/ccx/cube_static.frd similarity index 100% rename from src/Mod/Fem/test_files/ccx/cube_static.frd rename to src/Mod/Fem/femtest/testfiles/ccx/cube_static.frd diff --git a/src/Mod/Fem/test_files/ccx/cube_static.inp b/src/Mod/Fem/femtest/testfiles/ccx/cube_static.inp similarity index 100% rename from src/Mod/Fem/test_files/ccx/cube_static.inp rename to src/Mod/Fem/femtest/testfiles/ccx/cube_static.inp diff --git a/src/Mod/Fem/test_files/ccx/cube_static_expected_values b/src/Mod/Fem/femtest/testfiles/ccx/cube_static_expected_values similarity index 100% rename from src/Mod/Fem/test_files/ccx/cube_static_expected_values rename to src/Mod/Fem/femtest/testfiles/ccx/cube_static_expected_values diff --git a/src/Mod/Fem/test_files/ccx/spine_mesh.py b/src/Mod/Fem/femtest/testfiles/ccx/spine_mesh.py similarity index 100% rename from src/Mod/Fem/test_files/ccx/spine_mesh.py rename to src/Mod/Fem/femtest/testfiles/ccx/spine_mesh.py diff --git a/src/Mod/Fem/test_files/ccx/spine_points.csv b/src/Mod/Fem/femtest/testfiles/ccx/spine_points.csv similarity index 100% rename from src/Mod/Fem/test_files/ccx/spine_points.csv rename to src/Mod/Fem/femtest/testfiles/ccx/spine_points.csv diff --git a/src/Mod/Fem/test_files/ccx/spine_thermomech.dat b/src/Mod/Fem/femtest/testfiles/ccx/spine_thermomech.dat similarity index 100% rename from src/Mod/Fem/test_files/ccx/spine_thermomech.dat rename to src/Mod/Fem/femtest/testfiles/ccx/spine_thermomech.dat diff --git a/src/Mod/Fem/test_files/ccx/spine_thermomech.fcstd b/src/Mod/Fem/femtest/testfiles/ccx/spine_thermomech.fcstd similarity index 100% rename from src/Mod/Fem/test_files/ccx/spine_thermomech.fcstd rename to src/Mod/Fem/femtest/testfiles/ccx/spine_thermomech.fcstd diff --git a/src/Mod/Fem/test_files/ccx/spine_thermomech.frd b/src/Mod/Fem/femtest/testfiles/ccx/spine_thermomech.frd similarity index 100% rename from src/Mod/Fem/test_files/ccx/spine_thermomech.frd rename to src/Mod/Fem/femtest/testfiles/ccx/spine_thermomech.frd diff --git a/src/Mod/Fem/test_files/ccx/spine_thermomech.inp b/src/Mod/Fem/femtest/testfiles/ccx/spine_thermomech.inp similarity index 100% rename from src/Mod/Fem/test_files/ccx/spine_thermomech.inp rename to src/Mod/Fem/femtest/testfiles/ccx/spine_thermomech.inp diff --git a/src/Mod/Fem/test_files/ccx/spine_thermomech_expected_values b/src/Mod/Fem/femtest/testfiles/ccx/spine_thermomech_expected_values similarity index 100% rename from src/Mod/Fem/test_files/ccx/spine_thermomech_expected_values rename to src/Mod/Fem/femtest/testfiles/ccx/spine_thermomech_expected_values diff --git a/src/Mod/Fem/test_files/ccx/spine_volumes.csv b/src/Mod/Fem/femtest/testfiles/ccx/spine_volumes.csv similarity index 100% rename from src/Mod/Fem/test_files/ccx/spine_volumes.csv rename to src/Mod/Fem/femtest/testfiles/ccx/spine_volumes.csv diff --git a/src/Mod/Fem/test_files/elmer/ELMERSOLVER_STARTINFO b/src/Mod/Fem/femtest/testfiles/elmer/ELMERSOLVER_STARTINFO similarity index 100% rename from src/Mod/Fem/test_files/elmer/ELMERSOLVER_STARTINFO rename to src/Mod/Fem/femtest/testfiles/elmer/ELMERSOLVER_STARTINFO diff --git a/src/Mod/Fem/test_files/elmer/__init__.py b/src/Mod/Fem/femtest/testfiles/elmer/__init__.py similarity index 100% rename from src/Mod/Fem/test_files/elmer/__init__.py rename to src/Mod/Fem/femtest/testfiles/elmer/__init__.py diff --git a/src/Mod/Fem/test_files/elmer/case.sif b/src/Mod/Fem/femtest/testfiles/elmer/case.sif similarity index 100% rename from src/Mod/Fem/test_files/elmer/case.sif rename to src/Mod/Fem/femtest/testfiles/elmer/case.sif diff --git a/src/Mod/Fem/test_files/elmer/group_mesh.geo b/src/Mod/Fem/femtest/testfiles/elmer/group_mesh.geo similarity index 100% rename from src/Mod/Fem/test_files/elmer/group_mesh.geo rename to src/Mod/Fem/femtest/testfiles/elmer/group_mesh.geo