]> gitweb.factorcode.org Git - factor.git/commitdiff
load-all now skips vocabs tagged 'not loaded', and test-all skips vocabs tagged ...
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 14 Apr 2010 01:43:33 +0000 (18:43 -0700)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 14 Apr 2010 01:43:33 +0000 (18:43 -0700)
basis/tools/test/test.factor
basis/vocabs/hierarchy/hierarchy.factor
basis/vocabs/metadata/metadata.factor

index f3f53e43b71bab58470eea9f895850760096b61b..95f1ad8e2c086eca1b2e9ac7a722f356182506df 100644 (file)
@@ -2,11 +2,12 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs combinators compiler.units
 continuations debugger effects fry generalizations io io.files
-io.styles kernel lexer locals macros math.parser namespaces parser
-vocabs.parser prettyprint quotations sequences source-files splitting
-stack-checker summary unicode.case vectors vocabs vocabs.loader
-vocabs.files words tools.errors source-files.errors io.streams.string
-make compiler.errors ;
+io.styles kernel lexer locals macros math.parser namespaces
+parser vocabs.parser prettyprint quotations sequences
+source-files splitting stack-checker summary unicode.case
+vectors vocabs vocabs.loader vocabs.files vocabs.metadata words
+tools.errors source-files.errors io.streams.string make
+compiler.errors ;
 IN: tools.test
 
 TUPLE: test-failure < source-file-error continuation ;
@@ -126,7 +127,7 @@ SYMBOL: forget-tests?
     forget-tests? get
     [ [ [ forget-source ] each ] with-compilation-unit ] [ drop ] if ;
 
-: run-vocab-tests ( vocab -- )
+: test-vocab ( vocab -- )
     vocab dup [
         dup source-loaded?>> [
             vocab-tests
@@ -136,6 +137,8 @@ SYMBOL: forget-tests?
         ] [ drop ] if
     ] [ drop ] if ;
 
+: test-vocabs ( vocabs -- ) [ test-vocab ] each ;
+
 PRIVATE>
 
 TEST: unit-test
@@ -154,7 +157,6 @@ M: test-failure error. ( error -- )
 
 : :test-failures ( -- ) test-failures get errors. ;
 
-: test ( prefix -- )
-    child-vocabs [ run-vocab-tests ] each ;
+: test ( prefix -- ) child-vocabs test-vocabs ;
 
-: test-all ( -- ) "" test ;
+: test-all ( -- ) vocabs filter-don't-test test-vocabs ;
index 986091a543a0bc7d4b5eebbfc92ba8ef56d91270..609d485f0c7e13d1f8ddb36a6ca1ce8624457835 100644 (file)
@@ -97,9 +97,6 @@ MEMO: all-vocabs-recursive ( -- assoc )
 \r
 <PRIVATE\r
 \r
-: filter-unportable ( seq -- seq' )\r
-    [ vocab-name unportable? not ] filter ;\r
-\r
 : collect-vocabs ( quot -- seq )\r
     [ all-vocabs-recursive no-roots no-prefixes ] dip\r
     gather natural-sort ; inline\r
@@ -109,7 +106,7 @@ PRIVATE>
 : (load) ( prefix -- failures )\r
     [ child-vocabs-recursive no-roots no-prefixes ]\r
     [ dup find-vocab-root [ >vocab-link prefix ] [ drop ] if ] bi\r
-    filter-unportable\r
+    filter-don't-load\r
     require-all ;\r
 \r
 : load ( prefix -- )\r
index 5048b0edd065f880ac48a673df7a9bda9c82fc2c..bb14581f0d5c6700930b2c8a5f28dd96761de7e5 100644 (file)
@@ -103,12 +103,21 @@ ERROR: bad-platform name ;
 : supported-platform? ( platforms -- ? )
     [ t ] [ [ os swap class<= ] any? ] if-empty ;
 
-: unportable? ( vocab -- ? )
+: don't-load? ( vocab -- ? )
     {
-        [ vocab-tags "untested" swap member? ]
+        [ vocab-tags "not loaded" swap member? ]
         [ vocab-platforms supported-platform? not ]
     } 1|| ;
 
+: filter-don't-load ( vocabs -- vocabs' )
+    [ vocab-name don't-load? not ] filter ;
+
+: don't-test? ( vocab -- ? )
+    vocab-tags "not tested" swap member? ;
+
+: filter-don't-test ( vocabs -- vocabs' )
+    [ don't-test? not ] filter ;
+
 TUPLE: unsupported-platform vocab requires ;
 
 : unsupported-platform ( vocab requires -- )