aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2012-11-28 20:09:32 +0200
committerJukka Jylänki <jujjyl@gmail.com>2012-11-28 20:11:35 +0200
commit8784f0ff911cc3bbc17ae390f8a803afd5ba7c09 (patch)
tree7e111db6b692de5e3d450df91ce4b158a674d24c
parent710e8459cb5066739f6f67b18797bf815b773fc0 (diff)
Improve test runner build_native and run_native functions to output detailer error report when things go wrong.
-rwxr-xr-xtests/runner.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 1b440f6e..3f8a278f 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -279,10 +279,18 @@ process(sys.argv[1])
return ret
def build_native(self, filename):
- Popen([CLANG, '-O2', filename, '-o', filename+'.native'], stdout=PIPE).communicate()[0]
+ process = Popen([CLANG, '-O2', filename, '-o', filename+'.native'], stdout=PIPE);
+ output = process.communicate()
+ if process.returncode is not 0:
+ print >> sys.stderr, "Building native executable with command '%s' failed with a return code %d!" % (' '.join([CLANG, '-O2', filename, '-o', filename+'.native']), process.returncode)
+ print "Output: " + output[0]
def run_native(self, filename, args):
- Popen([filename+'.native'] + args, stdout=PIPE).communicate()[0]
+ process = Popen([filename+'.native'] + args, stdout=PIPE);
+ output = process.communicate()
+ if process.returncode is not 0:
+ print >> sys.stderr, "Running native executable with command '%s' failed with a return code %d!" % (' '.join([filename+'.native'] + args), process.returncode)
+ print "Output: " + output[0]
def assertIdentical(self, values, y):
if type(values) not in [list, tuple]: values = [values]