factor/extra/mason/test/test.factor

57 lines
1.7 KiB
Factor
Raw Normal View History

2008-09-16 00:20:33 -04:00
! Copyright (C) 2008 Eduardo Cavazos, Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs benchmark bootstrap.stage2
compiler.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
tools.vocabs words ;
2008-09-16 00:20:33 -04:00
IN: mason.test
: do-load ( -- )
try-everything
[ keys load-everything-vocabs-file to-file ]
[ load-everything-errors-file utf8 [ load-failures. ] with-file-writer ]
bi ;
2008-11-16 14:46:45 -05:00
GENERIC: word-vocabulary ( word -- vocabulary )
M: word word-vocabulary vocabulary>> ;
2008-11-16 16:31:31 -05:00
M: method-body word-vocabulary "method-generic" word-prop word-vocabulary ;
2008-11-16 14:46:45 -05:00
: do-compile-errors ( -- )
compiler-errors-file utf8 [
+error+ errors-of-type keys
[ word-vocabulary ] map
prune natural-sort .
] with-file-writer ;
2008-09-16 00:20:33 -04:00
: do-tests ( -- )
run-all-tests
[ keys test-all-vocabs-file to-file ]
[ test-all-errors-file utf8 [ test-failures. ] with-file-writer ]
bi ;
: do-help-lint ( -- )
"" run-help-lint
[ keys help-lint-vocabs-file to-file ]
[ help-lint-errors-file utf8 [ typos. ] with-file-writer ]
bi ;
: do-benchmarks ( -- )
run-benchmarks benchmarks-file to-file ;
: benchmark-ms ( quot -- ms )
benchmark 1000 /i ; inline
2008-09-16 00:20:33 -04:00
: do-all ( -- )
".." [
bootstrap-time get boot-time-file to-file
[ do-load do-compile-errors ] benchmark-ms load-time-file to-file
2008-11-23 23:05:04 -05:00
[ generate-help ] benchmark-ms html-help-time-file to-file
[ do-tests ] benchmark-ms test-time-file to-file
[ do-help-lint ] benchmark-ms help-lint-time-file to-file
[ do-benchmarks ] benchmark-ms benchmark-time-file to-file
2008-09-16 00:20:33 -04:00
] with-directory ;
MAIN: do-all