run-tests.py: print diff if reference output not existing.
authorVadim Gelfer <vadim.gelfer@gmail.com>
Wed, 10 May 2006 10:07:53 -0700
changeset 2246 3fd603eb6add
parent 2243 caf2c6ef5b0e
child 2247 546c76e5a3e6
run-tests.py: print diff if reference output not existing.
tests/run-tests.py
--- a/tests/run-tests.py	Wed May 10 11:53:56 2006 +0200
+++ b/tests/run-tests.py	Wed May 10 10:07:53 2006 -0700
@@ -182,10 +182,12 @@
         f = open(ref, "r")
         ref_out = f.read().splitlines()
         f.close()
-        if out != ref_out:
-            diffret = 1
-            print "\nERROR: %s output changed" % (test)
-            show_diff(ref_out, out)
+    else:
+        ref_out = ''
+    if out != ref_out:
+        diffret = 1
+        print "\nERROR: %s output changed" % (test)
+        show_diff(ref_out, out)
     if ret:
         print "\nERROR: %s failed with error code %d" % (test, ret)
     elif diffret: