Skip to content

Commit 847018a

Browse files
committed
Fix: restart test with custom run cmd
Make sure we can continue to run custom run commands as restart tests, which we use for Python restart coverage. Also fix the order of the added valgrind option, so that it can be combined with any of the run commands.
1 parent bd95dc4 commit 847018a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

regtest.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -669,15 +669,14 @@ def test_suite(argv):
669669

670670
base_cmd += f" {suite.globalAddToExecString} {test.runtime_params}"
671671

672-
if args.with_valgrind:
673-
base_cmd = "valgrind " + args.valgrind_options + " " + base_cmd
674-
675672
if test.run_as_script:
676673
base_cmd = f"./{test.run_as_script} {test.script_args}"
677674

678675
if test.customRunCmd is not None:
679676
base_cmd = test.customRunCmd
680677

678+
if args.with_valgrind:
679+
base_cmd = "valgrind " + args.valgrind_options + " " + base_cmd
681680

682681

683682
suite.run_test(test, base_cmd)
@@ -729,6 +728,17 @@ def test_suite(argv):
729728

730729
base_cmd += f" {suite.globalAddToExecString} {test.runtime_params}"
731730

731+
if test.run_as_script:
732+
base_cmd = f"./{test.run_as_script} {test.script_args}"
733+
# base_cmd += " amr.restart={}".format(restart_file)
734+
735+
if test.customRunCmd is not None:
736+
base_cmd = test.customRunCmd
737+
base_cmd += " amr.restart={}".format(restart_file)
738+
739+
if args.with_valgrind:
740+
base_cmd = "valgrind " + args.valgrind_options + " " + base_cmd
741+
732742
suite.run_test(test, base_cmd)
733743

734744
test.wall_time = time.time() - test.wall_time

0 commit comments

Comments
 (0)