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/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..d0a5a01f 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'))