Skip to content

Commit 1205404

Browse files
committed
Adjust the test data for all test methods
Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
1 parent 92c7df5 commit 1205404

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

TestCases/TestCase.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,7 @@ def run_test(self):
117117
self.cfg_file,
118118
logfilename)
119119

120-
if self.cpu_arch == 'aarch64':
121-
if len(self.test_vals_aarch64) != 0:
122-
self.test_vals = self.test_vals_aarch64
123-
124-
if len(self.reference_file_aarch64) != 0:
125-
self.reference_file = self.reference_file_aarch64
120+
self.adjust_test_data()
126121

127122
# Run SU2
128123
workdir = os.getcwd()
@@ -253,6 +248,8 @@ def run_filediff(self):
253248
# Adjust the number of iterations in the config file
254249
self.adjust_iter()
255250

251+
self.adjust_test_data()
252+
256253
# if root, add flag to mpirun
257254
if os.geteuid()==0:
258255
if self.su2_exec.startswith('mpirun'):
@@ -349,6 +346,8 @@ def run_opt(self):
349346
# Adjust the number of iterations in the config file
350347
self.adjust_opt_iter()
351348

349+
self.adjust_test_data()
350+
352351
# Assemble the shell command to run SU2
353352
logfilename = '%s.log' % os.path.splitext(self.cfg_file)[0]
354353
command = "%s %s > %s 2>&1" % (self.su2_exec, self.cfg_file, logfilename)
@@ -474,6 +473,8 @@ def run_geo(self):
474473
found_twist = False
475474
found_chord = False
476475

476+
self.adjust_test_data()
477+
477478
# if root, add flag to mpirun
478479
if os.geteuid()==0:
479480
if self.su2_exec.startswith('mpirun'):
@@ -601,6 +602,8 @@ def run_def(self):
601602
iter_missing = True
602603
start_solver = True
603604

605+
self.adjust_test_data()
606+
604607
# if root, add flag to mpirun
605608
if os.geteuid()==0:
606609
if self.su2_exec.startswith('mpirun'):
@@ -799,3 +802,12 @@ def is_enabled(self):
799802
print('Ignoring test "%s" because it is not enabled for the current CPU architecture: %s' % (self.tag, self.cpu_arch))
800803

801804
return is_enabled
805+
806+
def adjust_test_data(self):
807+
808+
if self.cpu_arch == 'aarch64':
809+
if len(self.test_vals_aarch64) != 0:
810+
self.test_vals = self.test_vals_aarch64
811+
812+
if len(self.reference_file_aarch64) != 0:
813+
self.reference_file = self.reference_file_aarch64

0 commit comments

Comments
 (0)