Skip to content

Commit

Permalink
Use run_dir if --exe is used
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdempsey90 committed Nov 18, 2024
1 parent 84fff4c commit 7cec177
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions tst/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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}"')

Expand Down
8 changes: 4 additions & 4 deletions tst/scripts/utils/artemis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -40,16 +39,17 @@

# 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
global artemis_log_dir
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


Expand Down

0 comments on commit 7cec177

Please sign in to comment.