Split SingleTestRunner.run()
@@ -219,18 +219,17 @@ class SingleTestRunner:
def run(self):
cmd = self._get_cmd()
if cmd is None:
- res = TestResult.SKIP
- duration = 0.0
- stdo = 'Not run because can not execute cross compiled binaries.'
- stde = None
- returncode = GNU_SKIP_RETURNCODE
+ skip_stdout = 'Not run because can not execute cross compiled binaries.'
+ return TestRun(res=TestResult.SKIP, returncode=GNU_SKIP_RETURNCODE,
+ should_fail=self.test.should_fail, duration=0.0,
+ stdo=skip_stdout, stde=None, cmd=None, env=self.test.env)
else:
wrap = TestHarness.get_wrapper(self.options)
-
if self.options.gdb:
self.test.timeout = None
+ return self._run_cmd(wrap + cmd + self.test.cmd_args + self.options.test_args)
- cmd = wrap + cmd + self.test.cmd_args + self.options.test_args
+ def _run_cmd(self, cmd):
starttime = time.time()
if len(self.test.extra_paths) > 0:
@@ -323,8 +322,7 @@ class SingleTestRunner:
res = TestResult.OK
else:
res = TestResult.FAIL
- returncode = p.returncode
- return TestRun(res, returncode, self.test.should_fail, duration, stdo, stde, cmd, self.test.env)
+ return TestRun(res, p.returncode, self.test.should_fail, duration, stdo, stde, cmd, self.test.env)
class TestHarness:
