help.lint: Add a MAIN: to help-lint to test lint from command line like we already have for unit tests.

Also flush stdout for both MAIN: test apps.
elevate-erg
Doug Coleman 2018-07-07 00:16:52 -05:00
parent 06b07b9e9c
commit 411a55314c
2 changed files with 14 additions and 5 deletions

View File

@ -1,9 +1,9 @@
! Copyright (C) 2006, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: assocs combinators continuations fry help
help.lint.checks help.topics io kernel namespaces parser
sequences source-files.errors vocabs.hierarchy vocabs words
classes locals tools.errors listener ;
USING: assocs classes combinators command-line continuations fry
help help.lint.checks help.topics io kernel listener locals
namespaces parser sequences source-files.errors system
tools.errors vocabs vocabs.hierarchy ;
IN: help.lint
SYMBOL: lint-failures
@ -97,3 +97,12 @@ PRIVATE>
[ word-help ] reject
[ article-parent ] filter
[ predicate? ] reject ;
: test-lint-main ( -- )
command-line get [ load ] each
help-lint-all
lint-failures get assoc-empty?
[ [ "==== FAILING LINT" print :lint-failures flush ] unless ]
[ 0 1 ? exit ] bi ;
MAIN: test-lint-main

View File

@ -213,7 +213,7 @@ M: test-failure error. ( error -- )
: test-main ( -- )
command-line get [ [ load ] [ test ] bi ] each
test-failures get empty?
[ [ "==== FAILING TESTS" print :test-failures ] unless ]
[ [ "==== FAILING TESTS" print flush :test-failures ] unless ]
[ 0 1 ? exit ] bi ;
MAIN: test-main