You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Osku Salerma <os...@iki.fi> on 2006/06/16 11:40:26 UTC

[PATCH] Better progress information in run_tests.py

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@iki.fi - http://www.oskusoft.com/osku/

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

Posted by Julian Foad <ju...@btopenworld.com>.
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.

I like this and the patch looks fine.  Committed in r20161.

> [[[
> * build/run_tests.py
>   (_run_test): Print information about number of tests left.
> ]]]

That log message is incomplete.  Here's what I wrote:

[[[
Provide numeric progress information when running the test suite, as it was
difficult to judge the progress without it.

Patch by: Osku Salerma <os...@iki.fi>

* build/run_tests.py
   (TestHarness::run): Pass the current and total test numbers to _run_test().
   (TestHarness::_run_test): Accept progress count arguments and print them
     after the test's name (in the form "[1/47]" for the first of 47 tests).
]]]

Thanks for the patch.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

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

Posted by Osku Salerma <os...@iki.fi>.
On Fri, 16 Jun 2006, Kamesh Jayachandran wrote:

> 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.

Can't avoid the one in the for loop, but you could avoid the one in
_run_tst, true. The reason I didn't do that is that it's simply more
natural to count the way God intended it, from zero, and do any needed
transformations when it's time to display it, IMHO.

--
Osku Salerma - osku@iki.fi - http://www.oskusoft.com/osku/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

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

Posted by Kamesh Jayachandran <ka...@collab.net>.
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@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