From 437d59498220fbe39095c1d5a854c5f0407b9741 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 16 Nov 2008 13:46:45 -0600 Subject: [PATCH] Put compiler errors in build report --- extra/mason/child/child.factor | 1 + extra/mason/common/common.factor | 1 + extra/mason/report/report.factor | 29 ++++++++++++++++++----------- extra/mason/test/test.factor | 18 ++++++++++++++++-- 4 files changed, 36 insertions(+), 13 deletions(-) diff --git a/extra/mason/child/child.factor b/extra/mason/child/child.factor index 02085a89b3..2bc6b191c4 100644 --- a/extra/mason/child/child.factor +++ b/extra/mason/child/child.factor @@ -61,6 +61,7 @@ IN: mason.child [ load-everything-vocabs-file eval-file empty? ] [ test-all-vocabs-file eval-file empty? ] [ help-lint-vocabs-file eval-file empty? ] + [ compiler-errors-file eval-file empty? ] } 0&& ; : build-child ( -- ) diff --git a/extra/mason/common/common.factor b/extra/mason/common/common.factor index 24a1292be3..fc7149e181 100644 --- a/extra/mason/common/common.factor +++ b/extra/mason/common/common.factor @@ -75,6 +75,7 @@ SYMBOL: stamp : boot-time-file "boot-time" ; : load-time-file "load-time" ; +: compiler-errors-file "compiler-errors" ; : test-time-file "test-time" ; : help-lint-time-file "help-lint-time" ; : benchmark-time-file "benchmark-time" ; diff --git a/extra/mason/report/report.factor b/extra/mason/report/report.factor index 0b5f21540a..1b2697a5d1 100644 --- a/extra/mason/report/report.factor +++ b/extra/mason/report/report.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: kernel namespaces debugger fry io io.files io.sockets io.encodings.utf8 prettyprint benchmark mason.common -mason.platform mason.config ; +mason.platform mason.config sequences ; IN: mason.report : time. ( file -- ) @@ -50,18 +50,25 @@ IN: mason.report nl - "Did not pass load-everything:" print - load-everything-vocabs-file cat - load-everything-errors-file cat + load-everything-vocabs-file eval-file [ + "== Did not pass load-everything:" print . + load-everything-errors-file cat + ] unless-empty - "Did not pass test-all:" print - test-all-vocabs-file cat - test-all-errors-file cat + compiler-errors-file eval-file [ + "== Vocabularies with compiler errors:" print . + ] unless-empty - "Did not pass help-lint:" print - help-lint-vocabs-file cat - help-lint-errors-file cat + test-all-vocabs-file eval-file [ + "== Did not pass test-all:" print . + test-all-errors-file cat + ] unless-empty - "Benchmarks:" print + help-lint-vocabs-file eval-file [ + "== Did not pass help-lint:" print . + help-lint-errors-file cat + ] unless-empty + + "== Benchmarks:" print benchmarks-file eval-file benchmarks. ] with-report ; \ No newline at end of file diff --git a/extra/mason/test/test.factor b/extra/mason/test/test.factor index cc83c9db44..760b51617d 100644 --- a/extra/mason/test/test.factor +++ b/extra/mason/test/test.factor @@ -2,7 +2,8 @@ ! See http://factorcode.org/license.txt for BSD license. USING: kernel namespaces assocs io.files io.encodings.utf8 prettyprint help.lint benchmark tools.time bootstrap.stage2 -tools.test tools.vocabs help.html mason.common ; +tools.test tools.vocabs help.html mason.common words generic +accessors compiler.errors sequences sets sorting ; IN: mason.test : do-load ( -- ) @@ -11,6 +12,19 @@ IN: mason.test [ load-everything-errors-file utf8 [ load-failures. ] with-file-writer ] bi ; +GENERIC: word-vocabulary ( word -- vocabulary ) + +M: word word-vocabulary vocabulary>> ; + +M: method-body word-vocabulary "method-generic" word-prop ; + +: do-compile-errors ( -- ) + compiler-errors-file utf8 [ + +error+ errors-of-type keys + [ word-vocabulary ] map + prune natural-sort . + ] with-file-writer ; + : do-tests ( -- ) run-all-tests [ keys test-all-vocabs-file to-file ] @@ -29,7 +43,7 @@ IN: mason.test : do-all ( -- ) ".." [ bootstrap-time get boot-time-file to-file - [ do-load ] benchmark load-time-file to-file + [ do-load do-compile-errors ] benchmark load-time-file to-file [ generate-help ] benchmark html-help-time-file to-file [ do-tests ] benchmark test-time-file to-file [ do-help-lint ] benchmark help-lint-time-file to-file