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

Re: Test suite setting exit code to non-zero on skipped test

From: Brian W. Fitzpatrick <fitz_at_red-bean.com>
Date: 2004-08-06 20:27:47 CEST

On Fri, 2004-08-06 at 10:12, kfogel@collab.net wrote:
> "Brian W. Fitzpatrick" <fitz@red-bean.com> writes:
> > =========
> > Proposal:
> >
> > Is there any reason why we should return non-zero just for skipping a
> > test? I can't see any reason why we need to error if we skip something,
> > but perhaps someone here has a good reason (svn blame tells me that
> > kfogel wrote the line that sets skips to non-zero).
>
> The situation is more complex than that. The _Predicate class in
> testcase.py uses the error number as an index into an array of action
> strings (see _Predicate.run_text(), and see the r8649 diff).
>
> This can be fixed, but the fix is more than just a one-line change...

Ook. Well in that case, Christian's patch should do the trick:

==============
diff -Naur cvs2svn-1.0.0-rc4-orig/svntest/main.py
cvs2svn-1.0.0-rc4/svntest/main.py
--- cvs2svn-1.0.0-rc4-orig/svntest/main.py 2004-06-23
06:43:38.000000000 +0200
+++ cvs2svn-1.0.0-rc4/svntest/main.py 2004-08-06 11:57:04.000000000
+0200
@@ -516,7 +516,10 @@

   if testnum is None:
     for n in range(1, len(test_list)):
- if run_one_test(n, test_list):
+ test_exit_code = run_one_test(n, test_list)
+ if test_exit_code == 2:
+ test_exit_code = 0 # ignore skipped test cases
+ if test_exit_code:
         exit_code = 1
   else:
     exit_code = run_one_test(testnum, test_list)
==============

-Fitz

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Aug 6 20:29:20 2004

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.