Bound to Shift-F2 per default in the UI Tools windows.
-USING: help.markup help.syntax kernel quotations io ;
+USING: help.markup help.syntax kernel quotations io strings vocabs.refresh ;
IN: tools.test
ARTICLE: "tools.test" "Unit testing"
HELP: test-all
{ $description "Runs unit tests for all loaded vocabularies." } ;
+HELP: refresh-and-test
+{ $values { "prefix" string } }
+{ $description "Like " { $link refresh } ", but runs unit tests for all reloaded vocabularies afterwards." } ;
+
+HELP: refresh-and-test-all
+{ $values { "prefix" string } }
+{ $description "Like " { $link refresh-all } ", but runs unit tests for all reloaded vocabularies afterwards." } ;
+
+{ refresh-and-test refresh-and-test-all } related-words
+
HELP: :test-failures
{ $description "Prints all pending unit test failures." } ;
source-files.errors.debugger splitting stack-checker summary
system tools.errors tools.time unicode vocabs vocabs.files
vocabs.hierarchy vocabs.hierarchy.private vocabs.loader
-vocabs.metadata vocabs.parser words ;
+vocabs.metadata vocabs.parser vocabs.refresh words ;
IN: tools.test
TUPLE: test-failure < source-file-error continuation ;
: test-all ( -- ) "" test ;
+: refresh-and-test ( prefix -- ) to-refresh [ do-refresh ] keepdd test-vocabs ;
+
+: refresh-and-test-all ( -- ) "" refresh-and-test ;
+
: test-main ( -- )
command-line get [
dup vocab-roots get member? [
! Copyright (C) 2006, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: kernel literals memory namespaces sequences system ui
+USING: kernel literals memory namespaces sequences system
+tools.test ui
ui.backend ui.commands ui.gestures ui.tools.browser
ui.tools.common ui.tools.error-list ui.tools.listener
vocabs.refresh ;
IN: ui.tools
\ refresh-all H{ { +nullary+ t } { +listener+ t } } define-command
+\ refresh-and-test-all H{ { +nullary+ t } { +listener+ t } } define-command
\ save H{ { +nullary+ t } } define-command
{ T{ key-down f ${ os macosx? M+ C+ ? } "w" } close-window }
{ T{ key-down f ${ os macosx? M+ C+ ? } "q" } com-exit }
{ T{ key-down f f "F2" } refresh-all }
+ { T{ key-down f { S+ } "F2" } refresh-and-test-all }
{ T{ key-down f f "F3" } show-error-list }
} os macosx? {
{ T{ key-down f { C+ M+ } "f" } toggle-fullscreen }