From 0a9a7c939ad02b70c2cc44ac98b557adeddca65d Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Thu, 15 Dec 2011 12:38:41 -0800 Subject: [PATCH] Fix test runner script to not crash if one of the tests_errors didn't return the expected result. --- run_tests.py | 9 ++++++--- tests_errors/lvalue-2.ispc | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/run_tests.py b/run_tests.py index 8c63255e..7756524b 100755 --- a/run_tests.py +++ b/run_tests.py @@ -108,7 +108,10 @@ def run_test(filename): sp = subprocess.Popen(shlex.split(ispc_cmd), stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - output = sp.communicate()[1] + out = sp.communicate() + output = "" + output += out[0] + output += out[1] got_error = (sp.returncode != 0) # figure out the error message we're expecting @@ -120,8 +123,8 @@ def run_test(filename): file.close() if (output.find(firstline) == -1): - print "Didn't see expected error message \"%s\" from " + \ - "test %s.\nActual outout: %s" % \ + print "OUT %s" % filename + print "Didnt see expected error message %s from test %s.\nActual output:\n%s" % \ (firstline, filename, output) error_count += 1 elif got_error == False: diff --git a/tests_errors/lvalue-2.ispc b/tests_errors/lvalue-2.ispc index 93dab8d2..ef067008 100644 --- a/tests_errors/lvalue-2.ispc +++ b/tests_errors/lvalue-2.ispc @@ -1,4 +1,4 @@ -// Can't assign to type "const uniform int32" on left-hand side +// Left hand side of assignment statement can't be assigned to int bar(){ 4 = 0;