You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by kf...@collab.net on 2004/08/06 15:12:05 UTC

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

"Brian W. Fitzpatrick" <fi...@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...

-Karl

> My suggested patch is:
> 
> ---------------------------------------------------------------
> Index: testcase.py
> ===================================================================
> --- testcase.py	(revision 10504)
> +++ testcase.py	(working copy)
> @@ -107,7 +107,7 @@
>          print ex.__doc__
>          sys.exit(255)
>        except svntest.Skip, ex:
> -        error = 2
> +        error = 0
>        except svntest.Failure, ex:
>          error = 1
>          # We captured Failure and its subclasses. We don't want to print
> ---------------------------------------------------------------
> 
> Thotz?
> -Fitz
> 
> 
> ---------------------------------------------------------------------
> 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

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

Posted by "Brian W. Fitzpatrick" <fi...@red-bean.com>.
On Fri, 2004-08-06 at 10:12, kfogel@collab.net wrote:
> "Brian W. Fitzpatrick" <fi...@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