Skip to content

Commit

Permalink
Simplify construction of run command line
Browse files Browse the repository at this point in the history
This is an attempt to optimize, but I think it also makes the code less convoluted.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
  • Loading branch information
smarr committed Jul 29, 2018
1 parent 8b57299 commit 76e218b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions rebench/model/run_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,18 +240,22 @@ def _expand_vars(self, string):
def cmdline(self):
if self._cmdline:
return self._cmdline
return self._construct_cmdline()

def _construct_cmdline(self):
cmdline = ""
if self._benchmark.suite.executor.path:
cmdline = "%s/" % (self._benchmark.suite.executor.path, )
cmdline = self._benchmark.suite.executor.path + "/"

cmdline += "%s %s" % (self._benchmark.suite.executor.executable,
self._benchmark.suite.executor.args or '')
cmdline += self._benchmark.suite.executor.executable + " "

if self._benchmark.suite.executor.args:
cmdline += str(self._benchmark.suite.executor.args) + " "

cmdline += self._benchmark.suite.command

if self._benchmark.extra_args is not None:
cmdline += " %s" % self._benchmark.extra_args
if self._benchmark.extra_args:
cmdline += str(self._benchmark.extra_args) + " "

cmdline = self._expand_vars(cmdline)

Expand Down

0 comments on commit 76e218b

Please sign in to comment.