Skip to content

Commit c56ecc1

Browse files
committed
Added a -v(algrind) option to run.py.
1 parent 18beb7a commit c56ecc1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/run.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
help="number of repetitions", metavar="NUMBER")
2121
parser.add_option("-q", action="store_true", dest="quiet", default=False,
2222
help="suppresses rust log output")
23+
parser.add_option("-v", action="store_true", dest="valgrind", default=False,
24+
help="runs under valgrind")
2325
parser.add_option("-p", action="store_true", dest="printSource",
2426
default=False, help="prints the test case's source")
2527
parser.add_option("-s", dest="seed", metavar="NUMBER", default=-1,
@@ -72,7 +74,14 @@ def getRustTests(filter):
7274
os.putenv("RUST_SEED", options.seed);
7375
else:
7476
os.putenv("RUST_SEED", str(i));
75-
result = os.system(rustProgram.replace(".rs", ".x86"));
77+
command = rustProgram.replace(".rs", ".x86");
78+
if (options.valgrind):
79+
command = "valgrind --leak-check=full " + \
80+
"--quiet --vex-iropt-level=0 " + \
81+
"--suppressions=etc/x86.supp " + \
82+
command;
83+
print "Running Command: " + command;
84+
result = os.system(command);
7685
exitStatus = result >> 8;
7786
signalNumber = result & 0xF;
7887
if (result == 0):

0 commit comments

Comments
 (0)