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

Re: [PATCH] Better progress information in run_tests.py

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-06-16 13:47:52 CEST

Hi,
Patch looks good.
Why not start cnt=1 so that you can avoid two additions once inside
_run_test and another in the for loop.

With regards
Kamesh Jayachandran
Osku Salerma wrote:
> I don't know about the rest of you, but since running all the tests takes
> a considerable amount of time, I'd like some information about how many
> tests are left. The attached patch modifies run_tests.py so that running
> the testsuite now prints:
>
> Running all tests in compat-test [1/46]...success
> Running all tests in config-test [2/46]...success
> Running all tests in diff-diff3-test [3/46]...success
>
> and so on.
>
> [[[
> * build/run_tests.py
> (_run_test): Print information about number of tests left.
> ]]]
>
> --
> Osku Salerma - osku_at_iki.fi - http://www.oskusoft.com/osku/
> ------------------------------------------------------------------------
>
> Index: build/run_tests.py
> ===================================================================
> --- build/run_tests.py (revision 20143)
> +++ build/run_tests.py (working copy)
> @@ -47,8 +47,10 @@
> 'Run all test programs given in LIST.'
> self._open_log('w')
> failed = 0
> + cnt = 0
> for prog in list:
> - failed = self._run_test(prog) or failed
> + failed = self._run_test(prog, cnt, len(list)) or failed
> + cnt += 1
> self._open_log('r')
> log_lines = self.log.readlines()
> skipped = filter(lambda x: x[:6] == 'SKIP: ', log_lines)
> @@ -73,7 +75,7 @@
> self.log.close()
> self.log = None
>
> - def _run_test(self, prog):
> + def _run_test(self, prog, test_nr, total_tests):
> 'Run a single test.'
>
> def quote(arg):
> @@ -84,7 +86,8 @@
>
> progdir, progbase = os.path.split(prog)
> # Using write here because we don't want even a trailing space
> - sys.stdout.write('Running all tests in ' + progbase + '...')
> + sys.stdout.write('Running all tests in %s [%d/%d]...' % (
> + progbase, test_nr + 1, total_tests))
> print >> self.log, 'START: ' + progbase
>
> if progbase[-3:] == '.py':
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jun 16 13:47:17 2006

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