diff --git a/.github/workflows/ubuntu-nvidia.yml b/.github/workflows/ubuntu-nvidia.yml index 249fd507..f85802f1 100644 --- a/.github/workflows/ubuntu-nvidia.yml +++ b/.github/workflows/ubuntu-nvidia.yml @@ -19,7 +19,7 @@ jobs: build-type: ["Debug", "Release"] mpi: ["No"] mtln: ["No"] - hdf: ["Yes"] + hdf: ["No"] name: ${{matrix.build-type}}- mpi ${{matrix.mpi}} - mtln ${{matrix.mtln}} - hdf ${{matrix.hdf}} @@ -59,12 +59,8 @@ jobs: run: | python -m pip install -r requirements.txt - - name: Run all wrapper tests - if: matrix.mtln=='Yes' - run: python -m pytest test/ - - - name: Run non-mtln wrapper tests - if: matrix.mtln=='No' - run: python -m pytest -m 'not mtln' test/ + - name: Run non-mtln and non-hdf wrapper tests + if: matrix.mtln=='No' || matrix.hdf=='No' + run: python -m pytest -m 'not mtln and not hdf5' test/ \ No newline at end of file diff --git a/.github/workflows/windows-intelLLVM.yml b/.github/workflows/windows-intelLLVM.yml index 09720815..f5239807 100644 --- a/.github/workflows/windows-intelLLVM.yml +++ b/.github/workflows/windows-intelLLVM.yml @@ -19,9 +19,15 @@ jobs: matrix: build-type: ["Debug", "Release"] mpi: ["No"] - mtln: ["Yes", "No"] + mtln: ["Yes"] hdf: ["Yes"] + include: + - build-type: "Release" + mpi: "No" + mtln: "No" + hdf: "Yes" + name: windows-intelLLVM ${{matrix.build-type}} - mpi ${{matrix.mpi}} - mtln ${{matrix.mtln}} steps: diff --git a/pytest.ini b/pytest.ini index 43c43f33..098efa49 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,4 +1,5 @@ [pytest] markers = mtln: tests which use mtln features. - codemodel: test that need xspice codemodels. \ No newline at end of file + codemodel: test that need xspice codemodels. + hdf5: tests that need hdf5. \ No newline at end of file diff --git a/src_pyWrapper/pyWrapper.py b/src_pyWrapper/pyWrapper.py index a46f089e..e90632c1 100644 --- a/src_pyWrapper/pyWrapper.py +++ b/src_pyWrapper/pyWrapper.py @@ -94,8 +94,8 @@ class FDTD(): def __init__(self, input_filename, path_to_exe=None, flags = [], run_in_folder = None): self._setFilename(input_filename) - if path_to_exe == None: - self.path_to_exe = os.getcwd() + DEFAULT_SEMBA_FDTD_PATH + if path_to_exe is None: + self.path_to_exe = os.path.join(os.getcwd(), DEFAULT_SEMBA_FDTD_PATH) else: self.path_to_exe = path_to_exe assert os.path.isfile(self.path_to_exe) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 79acc4a6..94e97d9b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -26,13 +26,4 @@ target_link_libraries(fdtd_tests ${SMBJSON_TESTS_LIBRARY} ${SYSTEM_TESTS_LIBRARY} GTest::gtest_main -) - - -if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND SEMBA_FDTD_ENABLE_MTLN) - add_custom_command(TARGET fdtd_tests POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${NGSPICE_DIR}ngspice.dll" - $ - ) -endif() +) \ No newline at end of file diff --git a/test/pyWrapper/test_full_system.py b/test/pyWrapper/test_full_system.py index 5c9b0d66..08730c2b 100644 --- a/test/pyWrapper/test_full_system.py +++ b/test/pyWrapper/test_full_system.py @@ -104,6 +104,7 @@ def test_towelHanger(tmp_path): assert np.allclose(p_expected[i].df.to_numpy()[:,0:3], p_solved.df.to_numpy()[:,0:3], rtol = 5e-2, atol=5e-2) +@pytest.mark.hdf5 def test_sphere(tmp_path): fn = CASE_FOLDER + 'sphere/sphere.fdtd.json' solver = FDTD(input_filename = fn, path_to_exe=SEMBA_EXE, run_in_folder=tmp_path) diff --git a/test/pyWrapper/test_pyWrapper.py b/test/pyWrapper/test_pyWrapper.py index 48208589..e52e7956 100644 --- a/test/pyWrapper/test_pyWrapper.py +++ b/test/pyWrapper/test_pyWrapper.py @@ -43,7 +43,7 @@ def test_read_point_probe(): def test_set_new_folder_to_run(tmp_path): - input = CASE_FOLDER + 'planewave/pw-in-box.fdtd.json' + input = os.path.join(CASE_FOLDER, 'planewave', 'pw-in-box.fdtd.json') solver = FDTD(input, path_to_exe=SEMBA_EXE, run_in_folder=tmp_path) solver.input['general']['numberOfSteps'] = 1 diff --git a/test/pyWrapper/utils.py b/test/pyWrapper/utils.py index 3432587e..441c1eb3 100644 --- a/test/pyWrapper/utils.py +++ b/test/pyWrapper/utils.py @@ -8,17 +8,17 @@ from sys import platform # Use of absolute path to avoid conflicts when changing directory. -EXE_FOLDER = os.getcwd() + '/build/bin/' -SEMBA_EXE = os.getcwd() + '/build/bin/semba-fdtd' -SEMBA_EXE_INTEL_LLVM_RELEASE = os.getcwd() + '/build-ubuntu-intelLLVM-release/bin/semba-fdtd' -SEMBA_EXE_INTEL_LLVM_DEBUG = os.getcwd() + '/build-ubuntu-intelLLVM-debug/bin/semba-fdtd' -TEST_DATA_FOLDER = os.getcwd() + '/testData/' +if platform == "linux": + SEMBA_EXE = os.path.join(os.getcwd(), 'build', 'bin', 'semba-fdtd') +elif platform == "win32": + SEMBA_EXE = os.path.join(os.getcwd(), 'build', 'bin', 'semba-fdtd.exe') -CASE_FOLDER = TEST_DATA_FOLDER + 'cases/' -MODELS_FOLDER = TEST_DATA_FOLDER + 'models/' -EXCITATIONS_FOLDER = TEST_DATA_FOLDER + 'excitations/' -OUTPUT_FOLDER = TEST_DATA_FOLDER + 'outputs/' -SPINIT_FOLDER = TEST_DATA_FOLDER + 'spinit/' +TEST_DATA_FOLDER = os.path.join(os.getcwd(), 'testData/') +CASE_FOLDER = os.path.join(TEST_DATA_FOLDER, 'cases/') +MODELS_FOLDER = os.path.join(TEST_DATA_FOLDER, 'models/') +EXCITATIONS_FOLDER = os.path.join(TEST_DATA_FOLDER, 'excitations/') +OUTPUT_FOLDER = os.path.join(TEST_DATA_FOLDER, 'outputs/') +SPINIT_FOLDER = os.path.join(TEST_DATA_FOLDER, 'spinit/') def getCase(case): return json.load(open(CASE_FOLDER + case + '.fdtd.json')) diff --git a/test/system/CMakeLists.txt b/test/system/CMakeLists.txt index 18ac1449..25ea17eb 100644 --- a/test/system/CMakeLists.txt +++ b/test/system/CMakeLists.txt @@ -20,15 +20,6 @@ target_link_libraries(system_test_fortran add_library(system_tests "system_tests.cpp") -if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND SEMBA_FDTD_ENABLE_MTLN) - add_custom_command(TARGET system_tests POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${NGSPICE_DIR}ngspice.dll" - $ - ) -endif() - - target_link_libraries(system_tests system_test_fortran GTest::gtest