[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

print test failures sooner

From: neels <neeels_at_gmail.com>
Date: Sun, 18 Apr 2010 05:11:30 +0200

Hi all,

I have this small patch that prints test failures right after each
tests section during 'make check', so that it looks like this:

[[[
Running tests in utf-test [31/75]...................success
Running tests in window-test [32/75]................success
Running tests in authz_tests.py [33/75].............success
Running tests in autoprop_tests.py [34/75]..........FAILURE
FAIL: autoprop_tests.py 1: add: config=no, commandline=none
FAIL: autoprop_tests.py 2: add: config=yes, commandline=none
FAIL: autoprop_tests.py 3: add: config=no, commandline=yes
FAIL: autoprop_tests.py 4: add: config=yes, commandline=yes
FAIL: autoprop_tests.py 5: add: config=no, commandline=no
FAIL: autoprop_tests.py 6: add: config=yes, commandline=no
FAIL: autoprop_tests.py 7: import: config=no, commandline=none
FAIL: autoprop_tests.py 8: import: config=yes, commandline=none
FAIL: autoprop_tests.py 9: import: config=no, commandline=yes
FAIL: autoprop_tests.py 10: import: config=yes, commandline=yes
FAIL: autoprop_tests.py 11: import: config=no, commandline=no
FAIL: autoprop_tests.py 12: import: config=yes, commandline=no
FAIL: autoprop_tests.py 13: add directory
FAIL: autoprop_tests.py 14: import directory
Running tests in basic_tests.py [35/75].............FAILURE
FAIL: basic_tests.py 1: basic checkout of a wc
Running tests in blame_tests.py [36/75].............success
Running tests in cat_tests.py [37/75]...............success
Running tests in changelist_tests.py [38/75]........success
]]]

I like this cause I don't need to go dig into tests.log myself if I
want to know the specific failing test numbers before 'make check'
completed. For me it's especially handy when I run the tests on a
remote computer.

If I commit this, do I break build bots and whatnot?

[[[
* build/run_tests.py: Print failures right after each tests section.
]]]

[[[
Index: build/run_tests.py
===================================================================
--- build/run_tests.py (revision 933797)
+++ build/run_tests.py (working copy)
@@ -110,7 +110,7 @@ class TestHarness:
   def run(self, list):
     '''Run all test programs given in LIST. Print a summary of results, if
        there is a log file. Return zero iff all test programs passed.'''
- self._open_log('w')
+ self._open_log('w+')
     failed = 0
     for cnt, prog in enumerate(list):
       failed = self._run_test(prog, cnt, len(list)) or failed
@@ -234,6 +234,7 @@ class TestHarness:
       test_info = '%s [%d/%d]' % (progbase, test_nr + 1, total_tests)
       sys.stdout.write('Running tests in %s' % (test_info, ))
       sys.stdout.write('.'*(35 - len(test_info)))
+ log_start = self.log.tell()

     log.write('START: %s\n' % progbase)
     log.flush()
@@ -315,6 +316,12 @@ class TestHarness:
     if self.log:
       if failed:
         print(TextColors.FAILURE + 'FAILURE' + TextColors.ENDC)
+ # Also try to print the failures of this test.
+ self.log.seek(log_start)
+ for line in self.log.readlines():
+ if line.startswith('FAIL'):
+ print line,
+ self.log.seek(0, os.SEEK_END)
       else:
         print(TextColors.SUCCESS + 'success' + TextColors.ENDC)

]]]

~Neels
Received on 2010-04-18 05:12:25 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.