1 ! Copyright (C) 2008, 2010 Eduardo Cavazos, Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors assocs benchmark bootstrap.stage2
4 compiler.errors source-files.errors generic help.html help.lint
5 io.directories io.encodings.utf8 io.files kernel mason.common
6 math namespaces prettyprint sequences sets sorting tools.test
7 tools.time words system io tools.errors vocabs vocabs.files
8 vocabs.hierarchy vocabs.errors vocabs.refresh locals
9 source-files compiler.units ;
14 [ keys load-all-vocabs-file to-file ]
15 [ load-all-errors-file utf8 [ load-failures. ] with-file-writer ]
18 GENERIC: word-vocabulary ( word -- vocabulary )
20 M: word word-vocabulary vocabulary>> ;
22 M: method word-vocabulary "method-generic" word-prop word-vocabulary ;
24 :: do-step ( errors summary-file details-file -- )
26 [ error-type +linkage-error+ eq? not ] filter
27 [ file>> ] map members natural-sort summary-file to-file
28 errors details-file utf8 [ errors. ] with-file-writer ;
31 test-all test-failures get
36 : cleanup-tests ( -- )
37 ! Free up some code heap space
39 vocabs [ vocab-tests [ forget-source ] each ] each
40 ] with-compilation-unit ;
43 help-lint-all lint-failures get values
48 : do-benchmarks ( -- )
50 [ benchmarks-file to-file ] [
51 [ keys benchmark-error-vocabs-file to-file ]
52 [ benchmark-error-messages-file utf8 [ benchmark-errors. ] with-file-writer ] bi
55 : do-compile-errors ( -- )
56 compiler-errors get values
58 compiler-error-messages-file
61 : check-boot-image ( -- )
62 "" to-refresh drop 2dup [ empty? not ] either?
64 "Boot image is out of date. Changed vocabs:" print
65 members [ print ] each
72 bootstrap-time get boot-time-file to-file
74 [ do-load ] benchmark load-time-file to-file
75 [ generate-help ] benchmark html-help-time-file to-file
76 [ do-tests ] benchmark test-time-file to-file
78 [ do-help-lint ] benchmark help-lint-time-file to-file
79 [ do-benchmarks ] benchmark benchmark-time-file to-file