From cd9264be5594a7715dde29b3c0be82a00baf5fd1 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 9 Feb 2019 12:43:32 +0100 Subject: always use cmd_prefix --- src/benchmark.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/benchmark.py b/src/benchmark.py index 1aa5cf9..583b05b 100644 --- a/src/benchmark.py +++ b/src/benchmark.py @@ -150,11 +150,19 @@ class Benchmark (object): i += 1 print(i, "of", n, "\r", end='') - actual_cmd = self.measure_cmd + " " - perm_dict = perm._asdict() perm_dict.update(t) - actual_cmd += self.cmd.format(**perm_dict) + actual_cmd = self.cmd.format(**perm_dict) + + # Find absolute path of executable + binary_end = actual_cmd.find(" ") + binary = subprocess.check_output(["whereis", actual_cmd[0:binary_end]], + universal_newlines=True).split()[1] + actual_cmd = binary + actual_cmd[binary_end:] + + actual_cmd = t["cmd_prefix"] + " " + actual_cmd + + actual_cmd = self.measure_cmd + " " + actual_cmd res = subprocess.run(actual_cmd.split(), stderr=subprocess.PIPE, -- cgit v1.2.3