From a7ee58dc83c119d02bcf6d44a919e03af28c7cb3 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 12 Apr 2010 14:45:43 -0700 Subject: [PATCH] mason.test: forget test vocabs right after each test, instead of at the end --- basis/tools/test/test.factor | 13 +++++++++++-- extra/mason/test/test.factor | 19 ++++++------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/basis/tools/test/test.factor b/basis/tools/test/test.factor index 8dda4fe16c..f3f53e43b7 100644 --- a/basis/tools/test/test.factor +++ b/basis/tools/test/test.factor @@ -1,4 +1,4 @@ -! 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 @@ -118,12 +118,21 @@ PRIVATE> '[ _ run-file ] [ file-failure ] recover ] with-variable ; +SYMBOL: forget-tests? + > [ - vocab-tests [ run-test-file ] each + vocab-tests + [ [ run-test-file ] each ] + [ forget-tests ] + bi ] [ drop ] if ] [ drop ] if ; diff --git a/extra/mason/test/test.factor b/extra/mason/test/test.factor index e99f76c8c4..8e248e861b 100644 --- a/extra/mason/test/test.factor +++ b/extra/mason/test/test.factor @@ -1,12 +1,11 @@ ! 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 ( -- ) @@ -28,17 +27,12 @@ M: method word-vocabulary "method-generic" word-prop word-vocabulary ; 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 @@ -76,7 +70,6 @@ M: method word-vocabulary "method-generic" word-prop word-vocabulary ; [ 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