diff --git a/.travis.yml b/.travis.yml index 43ad8fd9fa..caf8bfca07 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,7 +50,7 @@ script: > ( echo "=== Factor Configure Postgresql ===" ; ./factor -e='USING: db.postgresql namespaces memory ; T{ postgresql-db f "localhost" f f f f "postgres" "" } \ postgresql-db set-global save' ; ret=$? ; echo "=== $ret ==="; [ $ret == 0 ] ) && ( echo "=== Factor Configure Imap ===" ; ./factor -e='USING: imap namespaces memory environment accessors ; T{ imap-settings { host "imap.gmail.com" } } "FACTOR_IMAP_USER" os-env >>email "FACTOR_IMAP_PASSWORD" os-env >>password \ imap-settings set-global save' ; ret=$? ; echo "=== $ret ==="; [ $ret == 0 ] ) && ( echo "=== Mkdir ===" ; mkdir -p mason/builds ; ret=$? ; echo "=== $ret ==="; [ $ret == 0 ] ) && - ( echo "=== Factor tests ===" ; cd mason/builds && ../../factor -e='USING: namespaces tools.test mason.test ; f long-unit-tests-enabled? set-global t skip-mason-benchmarks set-global do-all' < /dev/null | awk 'NR<1000 || /^Loading resource|Unit Test/' ; ret=${PIPESTATUS[0]} ; echo "=== $ret ==="; [ $ret == 0 ]) && + ( echo "=== Factor tests ===" ; cd mason/builds && ../../factor -e='USING: namespaces tools.test mason.test benchmark ; f long-unit-tests-enabled? set-global t benchmarks-disabled? set-global do-all' < /dev/null | awk 'NR<1000 || /^Loading resource|Unit Test/' ; ret=${PIPESTATUS[0]} ; echo "=== $ret ==="; [ $ret == 0 ]) && ( echo "=== Factor report === " ; cd mason && ../factor -e='USING: mason.config mason.report namespaces ; "." builds-dir [ successful-report ] with-variable' ; ret=$? ; echo "=== $ret ==="; [ $ret == 0 ]) && ( echo "=== Dump report === " ;[[ "$TRAVIS_OS_NAME" != "osx" ]] && links -dump mason/report || cat mason/report ; ret=$? ; echo "=== $ret ==="; [ $ret == 0 ]) && [ ! -s mason/test-all-errors ] diff --git a/extra/benchmark/benchmark.factor b/extra/benchmark/benchmark.factor index c3b1c97426..46f23009f6 100644 --- a/extra/benchmark/benchmark.factor +++ b/extra/benchmark/benchmark.factor @@ -6,6 +6,8 @@ sequences tools.profiler.sampling tools.test tools.time vocabs.hierarchy vocabs.loader ; IN: benchmark +SYMBOL: benchmarks-disabled? + : run-timing-benchmark ( vocab -- time ) 5 swap '[ gc [ _ run ] benchmark ] replicate infimum ; @@ -16,7 +18,12 @@ IN: benchmark "benchmark" disk-child-vocab-names [ find-vocab-root ] filter ; : find-benchmark-vocabs ( -- seq ) - command-line get [ all-benchmark-vocabs ] when-empty ; + benchmarks-disabled? get [ + "benchmarks-disabled? is true, not benchmarking anything!" print + { } + ] [ + command-line get [ all-benchmark-vocabs ] when-empty + ] if ; array sift ] with-report ; @@ -143,7 +138,7 @@ IN: mason.report test-all-vocabs-file help-lint-vocabs-file compiler-errors-file - skip-mason-benchmarks get [ t ] [ benchmark-error-vocabs-file ] if + benchmark-error-vocabs-file } [ eval-file empty? ] all? ; : success ( -- status ) diff --git a/extra/mason/test/test.factor b/extra/mason/test/test.factor index 420e3b9eb3..bd2e9dc50a 100644 --- a/extra/mason/test/test.factor +++ b/extra/mason/test/test.factor @@ -101,8 +101,6 @@ M: method word-vocabulary "method-generic" word-prop word-vocabulary ; user-init-errors get-global assoc-empty? [ f ] [ :user-init-errors t ] if ; -SYMBOL: skip-mason-benchmarks - : do-all ( -- ) f parser-quiet? set-global f restartable-tests? set-global @@ -114,15 +112,7 @@ SYMBOL: skip-mason-benchmarks [ 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 - ! Because of the way mason is written, it expects these files to exist. - ! So fake them. - skip-mason-benchmarks get [ - { } benchmarks-file to-file - benchmark-error-messages-file touch-file - 0 benchmark-time-file to-file - ] [ - [ do-benchmarks ] benchmark benchmark-time-file to-file - ] if + [ do-benchmarks ] benchmark benchmark-time-file to-file do-compile-errors ] with-directory ;