From 5b899b7bff3d5713501024691c5468caab761abe Mon Sep 17 00:00:00 2001 From: Christopher Sherman Date: Tue, 23 Jan 2024 16:50:42 -0800 Subject: [PATCH] Updating the ats environment update script --- geos_ats_package/geos_ats/environment_setup.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/geos_ats_package/geos_ats/environment_setup.py b/geos_ats_package/geos_ats/environment_setup.py index 145e548..2864a8e 100644 --- a/geos_ats_package/geos_ats/environment_setup.py +++ b/geos_ats_package/geos_ats/environment_setup.py @@ -4,20 +4,23 @@ import argparse -def setup_ats(src_path, build_path, ats_xargs, ats_machine, ats_machine_dir): +def setup_ats(src_path, build_path, baseline_dir, working_dir, ats_xargs, ats_machine, ats_machine_dir): bin_dir = os.path.join(build_path, "bin") geos_ats_fname = os.path.join(bin_dir, "run_geos_ats") - ats_dir = os.path.abspath(os.path.join(src_path, "integratedTests", "tests", "allTests")) test_path = os.path.join(build_path, "integratedTests") link_path = os.path.join(test_path, "integratedTests") run_script_fname = os.path.join(test_path, "geos_ats.sh") log_dir = os.path.join(test_path, "TestResults") + baseline_dir = os.path.abspath(baseline_dir) + working_dir = os.path.abspath(working_dir) + ats_main_file = os.path.abspath(os.path.join(src_path, 'inputFiles', 'main.ats')) - # Create a symbolic link to test directory + # Create a symbolic link to working directory + os.makedirs(working_dir, exist_ok=True) if os.path.islink(link_path): print('integratedTests symlink already exists') else: - os.symlink(ats_dir, link_path) + os.symlink(working_dir, link_path) # Build extra arguments that should be passed to ATS joined_args = [' '.join(x) for x in ats_xargs] @@ -30,7 +33,7 @@ def setup_ats(src_path, build_path, ats_xargs, ats_machine, ats_machine_dir): # Write the bash script to run ats. with open(run_script_fname, "w") as g: g.write("#!/bin/bash\n") - g.write(f"{geos_ats_fname} {bin_dir} --workingDir {ats_dir} --logs {log_dir} {ats_args} \"$@\"\n") + g.write(f"{geos_ats_fname} {bin_dir} {ats_main_file} --workingDir {working_dir} --baselineDir {baseline_dir} --logs {log_dir} {ats_args} \"$@\"\n") # Make the script executable st = os.stat(run_script_fname) @@ -46,11 +49,13 @@ def main(): parser = argparse.ArgumentParser(description="Setup ATS script") parser.add_argument("src_path", type=str, help="GEOS src path") parser.add_argument("build_path", type=str, help="GEOS build path") + parser.add_argument("baseline_dir", type=str, help="GEOS test baseline root directory") + parser.add_argument("working_dir", type=str, help="GEOS test working root directory") parser.add_argument("--ats", nargs='+', default=[], action="append", help="Arguments that should be passed to ats") parser.add_argument("--machine", type=str, default='', help="ATS machine name") parser.add_argument("--machine-dir", type=str, default='', help="ATS machine directory") options, unkown_args = parser.parse_known_args() - setup_ats(options.src_path, options.build_path, options.ats, options.machine, options.machine_dir) + setup_ats(options.src_path, options.build_path, options.baseline_dir, options.working_dir, options.ats, options.machine, options.machine_dir) if __name__ == '__main__':