-! Copyright (C) 2003, 2009 Slava Pestov.
+! Copyright (C) 2003, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs combinators compiler.units
continuations debugger effects fry generalizations io io.files
'[ _ run-file ] [ file-failure ] recover
] with-variable ;
+SYMBOL: forget-tests?
+
<PRIVATE
+: forget-tests ( files -- )
+ forget-tests? get
+ [ [ [ forget-source ] each ] with-compilation-unit ] [ drop ] if ;
+
: run-vocab-tests ( vocab -- )
vocab dup [
dup source-loaded?>> [
- vocab-tests [ run-test-file ] each
+ vocab-tests
+ [ [ run-test-file ] each ]
+ [ forget-tests ]
+ bi
] [ drop ] if
] [ drop ] if ;
! Copyright (C) 2008, 2010 Eduardo Cavazos, Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs benchmark bootstrap.stage2
-compiler.errors source-files.errors generic help.html help.lint
-io.directories io.encodings.utf8 io.files kernel mason.common
-math namespaces prettyprint sequences sets sorting tools.test
-tools.time words system io tools.errors vocabs vocabs.files
-vocabs.hierarchy vocabs.errors vocabs.refresh locals
-source-files compiler.units ;
+compiler.errors generic help.html help.lint io io.directories
+io.encodings.utf8 io.files kernel locals mason.common
+namespaces sequences sets sorting source-files.errors system
+tools.errors tools.test tools.time vocabs.errors
+vocabs.hierarchy vocabs.refresh words ;
IN: mason.test
: do-load ( -- )
errors details-file utf8 [ errors. ] with-file-writer ;
: do-tests ( -- )
+ forget-tests? on
test-all test-failures get
test-all-vocabs-file
test-all-errors-file
do-step ;
-: cleanup-tests ( -- )
- ! Free up some code heap space
- [
- vocabs [ vocab-tests [ forget-source ] each ] each
- ] with-compilation-unit ;
-
: do-help-lint ( -- )
help-lint-all lint-failures get values
help-lint-vocabs-file
[ do-load ] benchmark load-time-file to-file
[ generate-help ] benchmark html-help-time-file to-file
[ do-tests ] benchmark test-time-file to-file
- cleanup-tests
[ do-help-lint ] benchmark help-lint-time-file to-file
[ do-benchmarks ] benchmark benchmark-time-file to-file
do-compile-errors