]> gitweb.factorcode.org Git - factor.git/commitdiff
tools.test: add a restartable-tests? flag to control restarts.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 31 Mar 2016 13:51:17 +0000 (06:51 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 31 Mar 2016 13:51:17 +0000 (06:51 -0700)
basis/tools/test/test.factor
extra/mason/test/test.factor

index 825e893473d55b6bf29d70e7542a32e3ae9e7977..9837d83ce353210987150bdca3d9579a77062e9c 100644 (file)
@@ -31,6 +31,9 @@ T{ error-type-holder
 SYMBOL: verbose-tests?
 t verbose-tests? set-global
 
+SYMBOL: restartable-tests?
+t restartable-tests? set-global
+
 : <test-failure> ( error experiment path line# -- test-failure )
     test-failure new
         swap >>line#
@@ -41,7 +44,7 @@ t verbose-tests? set-global
 
 <PRIVATE
 
-: failure ( error experiment file line# -- )
+: failure ( error experiment path line# -- )
     "--> test failed!" print
     <test-failure> test-failures get push
     notify-error-observers ;
@@ -126,11 +129,11 @@ PRIVATE>
     dup current-test-file [
         test-failures get current-test-file get +test-failure+ delete-file-errors
         '[ _ run-file ] [
-            dup compute-restarts empty? [
-                file-failure
-            ] [
-                rethrow
-            ] if
+            restartable-tests? get
+            [ dup compute-restarts empty? not ] [ f ] if [
+                "Continue running tests" over 2array 1array
+                rethrow-restarts
+            ] when [ file-failure ] when*
         ] recover
     ] with-variable ;
 
index 467da58be14f47ddcb729bad9fb39b877258f81b..bd2e9dc50aa0bdb08f280a07b9a5818c59f43ff2 100644 (file)
@@ -103,6 +103,7 @@ M: method word-vocabulary "method-generic" word-prop word-vocabulary ;
 
 : do-all ( -- )
     f parser-quiet? set-global
+    f restartable-tests? set-global
     ".." [
         run-mason-rc check-user-init-errors [ 1 exit ] when
         bootstrap-time get boot-time-file to-file