[Pkg-bazaar-commits] ./bzr/unstable r513: - show some log output if the tests fail

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:19:29 UTC 2009


------------------------------------------------------------
revno: 513
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Mon 2005-05-16 15:32:24 +1000
message:
  - show some log output if the tests fail
modified:
  testbzr
-------------- next part --------------
=== modified file 'testbzr'
--- a/testbzr	2005-05-16 05:28:10 +0000
+++ b/testbzr	2005-05-16 05:32:24 +0000
@@ -136,6 +136,8 @@
 if os.path.exists(TESTDIR):
     shutil.rmtree(TESTDIR)
 
+start_dir = os.getcwd()
+
 
 logfile = open(LOGFILENAME, 'wt', buffering=1)
 
@@ -379,4 +381,9 @@
                      + '*' * 50 + '\n')
     logfile.write('tests failed!\n')
     traceback.print_exc(None, logfile)
+    logfile.close()
+
+    sys.stdout.writelines(file(os.path.join(start_dir, LOGFILENAME), 'rt').readlines()[-50:])
+    
     sys.exit(1)
+



More information about the Pkg-bazaar-commits mailing list