diff --git a/tst/regression/test_suites/output_hdf5/output_hdf5.py b/tst/regression/test_suites/output_hdf5/output_hdf5.py index fcd88fcf4fec..a3b89d059b80 100644 --- a/tst/regression/test_suites/output_hdf5/output_hdf5.py +++ b/tst/regression/test_suites/output_hdf5/output_hdf5.py @@ -81,16 +81,7 @@ def Analyse(self,parameters): analyze_status = True print(os.getcwd()) - # Determine path to parthenon installation - # Fallback to relative path on failure - try: - parthenonPath = os.path.realpath(__file__) - idx = parthenonPath.rindex('/parthenon/') - parthenonPath = os.path.join(parthenonPath[:idx],'parthenon') - except ValueError: - baseDir = os.path.dirname(__file__) - parthenonPath = baseDir + '/../../../..' - sys.path.insert(1, parthenonPath+'/scripts/python') + sys.path.insert(1, parameters.parthenon_path + '/scripts/python') try: import phdf_diff @@ -101,10 +92,10 @@ def Analyse(self,parameters): # TODO(pgrete) make sure this also works/doesn't fail for the user ret_2d = phdf_diff.compare([ 'advection_2d.out0.00001.phdf', - parthenonPath+'/tst/regression/gold_standard/advection_2d.out0.00001.phdf']) + parameters.parthenon_path + '/tst/regression/gold_standard/advection_2d.out0.00001.phdf']) ret_3d = phdf_diff.compare([ 'advection_3d.out0.00001.phdf', - parthenonPath+'/tst/regression/gold_standard/advection_3d.out0.00001.phdf']) + parameters.parthenon_path + '/tst/regression/gold_standard/advection_3d.out0.00001.phdf']) if ret_2d != 0 or ret_3d != 0: analyze_status = False diff --git a/tst/regression/utils/test_case.py b/tst/regression/utils/test_case.py index 538dd294bee8..e9817b0c2536 100644 --- a/tst/regression/utils/test_case.py +++ b/tst/regression/utils/test_case.py @@ -28,6 +28,7 @@ class Parameters(): driver_input_path = "" test_path = "" output_path = "" + parthenon_path = "" mpi_cmd = "" num_ranks = 1 mpi_opts = "" @@ -82,6 +83,14 @@ def __init__(self,run_test_path,**kwargs): else: output_path = os.path.abspath(output_path) + try: + parthenon_path = os.path.realpath(__file__) + idx = parthenon_path.rindex('/parthenon/') + self.parameters.parthenon_path = os.path.join(parthenon_path[:idx],'parthenon') + except ValueError: + baseDir = os.path.dirname(__file__) + self.parameters.parthenon_path = os.path.abspath(baseDir + '/../../../') + self.__test_module = 'test_suites.' + test_base_name + '.' + test_base_name test_module = 'test_suites.' + test_base_name + '.' + test_base_name