diff scripts/testfun/test.m @ 6728:a25173d58101

[project @ 2007-06-14 21:10:48 by jwe]
author jwe
date Thu, 14 Jun 2007 21:10:48 +0000
parents 76a1a953533d
children 230f9c49857e
line wrap: on
line diff
--- a/scripts/testfun/test.m
+++ b/scripts/testfun/test.m
@@ -412,7 +412,7 @@
       __code = ""; # code already processed
       
     ## TEST
-    elseif (strcmp (__type, "test"))
+    elseif (strcmp (__type, "test") || strcmp (__type, "xtest"))
       __istest = 1;
       ## code will be evaluated below
       
@@ -436,8 +436,12 @@
 		       __shared_r,__shared, __code));
 	eval (sprintf ("%s__test__(%s);", __shared_r, __shared));
       catch
-	__success = 0;
-	__msg = sprintf ("%stest failed\n%s", __signal_fail, __error_text__);
+        if (strcmp (__type, "xtest"))
+           __msg = sprintf ("%sknown failure\n%s", __signal_fail, __error_text__);
+        else
+           __msg = sprintf ("%stest failed\n%s", __signal_fail, __error_text__);
+	   __success = 0;
+        endif
 	if (isempty (__error_text__))
 	  error ("empty error text, probably Ctrl-C --- aborting"); 
 	endif
@@ -579,6 +583,9 @@
   endif
 endfunction
 
+### Test for a known failure
+%!xtest error("This test is known to fail")
+
 ### example from toeplitz
 %!shared msg
 %! msg="expecting vector arguments";