diff --git a/tst/run_tests.py b/tst/run_tests.py index 5fd8834..88589de 100755 --- a/tst/run_tests.py +++ b/tst/run_tests.py @@ -291,13 +291,13 @@ def set_paths(args): ): raise TestError(f'Provided executable "{artemis_exe_path}" not found!') # Set the valid provided executable path - artemis.set_executable(os.path.abspath(artemis_exe_path)) + artemis.set_executable_from_path(os.path.abspath(artemis_exe_path), False) else: # If we are in a directory with an executable, default to using that local_path = os.path.join(os.getcwd(), "artemis") if os.path.exists(local_path) and os.access(local_path, os.X_OK): print(f"Found local executable {local_path}") - artemis.set_executable(local_path) + artemis.set_executable(local_path, True) else: # Check if we are one level up from the executable local_path = os.path.join(os.getcwd(), "CMakeCache.txt") @@ -306,7 +306,7 @@ def set_paths(args): exe_path = read_cmakecache(local_path) if os.path.exists(exe_path) and os.access(exe_path, os.X_OK): print(f"Found local executable {exe_path}") - artemis.set_executable(exe_path) + artemis.set_executable(exe_path, True) else: raise TestError(f'Could not find executable in "{exe_path}"') diff --git a/tst/scripts/utils/artemis.py b/tst/scripts/utils/artemis.py index 055ad9f..7af6e46 100644 --- a/tst/scripts/utils/artemis.py +++ b/tst/scripts/utils/artemis.py @@ -31,7 +31,6 @@ ) artemis_executable = os.path.join(artemis_dir, "tst", "build", "src", "artemis") artemis_inputs_dir = os.path.join(artemis_dir, "inputs") -# artemis_fig_dir = "./figs/" artemis_run_dir = os.path.join(artemis_dir, "tst", "build", "src", "tst") artemis_fig_dir = os.path.join(artemis_dir, "tst", "figs") artemis_log_dir = os.path.join(artemis_dir, "tst") @@ -40,7 +39,7 @@ # Optionally set custom path for executable, and update other variables related to where # we run the code -def set_executable(executable_path): +def set_executable(executable_path, use_current): global artemis_executable global artemis_run_dir global artemis_fig_dir @@ -48,8 +47,9 @@ def set_executable(executable_path): global custom_exe artemis_executable = executable_path artemis_run_dir = os.path.join(os.path.dirname(artemis_executable), "tst") - artemis_fig_dir = os.path.join(current_dir, "figs") - artemis_log_dir = current_dir + output_dir = current_dir if use_current else artemis_run_dir + artemis_fig_dir = os.path.join(output_dir, "figs") + artemis_log_dir = output_dir custom_exe = True