aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergio Martins <smartins@kde.org>2018-09-22 18:47:22 +0100
committerSergio Martins <smartins@kde.org>2018-09-22 18:49:30 +0100
commita81154e974545bca4beb6472cbc64eeff6868d20 (patch)
treef2ea6d1f1d4e35cb54a98951b830b8140ce0d47b
parent13590f53043fb1b1854b8706a415bcaee7c24f6f (diff)
run_tests.py: Print compiler output when test fails to compile
-rwxr-xr-xtests/run_tests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/run_tests.py b/tests/run_tests.py
index 65a65c43..00c8c33f 100755
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -393,6 +393,12 @@ def extract_word(word, in_file, out_file):
in_f.close()
out_f.close()
+def print_file(filename):
+ f = open(filename, 'r')
+ print f.read()
+ f.close()
+
+
def run_unit_test(test, is_standalone):
if test.check.clazy_standalone_only and not is_standalone:
return True
@@ -441,6 +447,10 @@ def run_unit_test(test, is_standalone):
if (not cmd_success and not must_fail) or (cmd_success and must_fail):
print "[FAIL] " + checkname + " (Failed to build test. Check " + output_file + " for details)"
+ print "-------------------"
+ print "Contents of %s:" % output_file
+ print_file(output_file)
+ print "-------------------"
print
return False