From 98060c4bc97c5cda5b927105e4df6476bb3fba86 Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Wed, 13 Feb 2008 05:50:45 -0600 Subject: [PATCH] builder: run benchmarks --- extra/builder/builder.factor | 26 +++++++++++++++++++++----- extra/builder/test/test.factor | 7 +++++-- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/extra/builder/builder.factor b/extra/builder/builder.factor index 3563a6112a..0c9b0a2aba 100644 --- a/extra/builder/builder.factor +++ b/extra/builder/builder.factor @@ -11,6 +11,8 @@ IN: builder : runtime ( quot -- time ) benchmark nip ; +: minutes>ms ( min -- ms ) 60 * 1000 * ; + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! SYMBOL: builder-recipients @@ -97,6 +99,7 @@ VAR: stamp } } { +stdout+ "../boot-log" } { +stderr+ +stdout+ } + { +timeout+ ,[ 20 minutes>ms ] } } ; : builder-test ( -- desc ) `{ ,[ factor-binary ] "-run=builder.test" } ; @@ -145,10 +148,22 @@ SYMBOL: build-status ! bootstrap [ "Bootstrap error" print "../boot-log" cat ] run-or-bail - bootstrap dup dispose process-stream-process wait-for-process zero? not - [ "Bootstrap error" print "../boot-log" cat "bootstrap error" throw ] - when +! bootstrap +! dup dispose process-stream-process wait-for-process +! zero? not +! [ "Bootstrap error" print "../boot-log" cat "bootstrap error" throw ] +! when + [ + bootstrap + dup dispose process-stream-process wait-for-process + zero? not + [ "bootstrap non-zero" throw ] + when + ] + [ "Bootstrap error" print "../boot-log" cat "bootstrap" throw ] + recover + [ builder-test try-process ] [ "Builder test error" print throw ] recover @@ -160,6 +175,9 @@ SYMBOL: build-status "Did not pass load-everything: " print "../load-everything-vocabs" cat "Did not pass test-all: " print "../test-all-vocabs" cat + "Benchmarks: " print + "../benchmarks" [ stdio get contents eval ] with-file-in . + ] with-file-out ; : build ( -- ) @@ -168,8 +186,6 @@ SYMBOL: build-status ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -: minutes>ms ( min -- ms ) 60 * 1000 * ; - : updates-available? ( -- ? ) git-id git-pull run-process drop diff --git a/extra/builder/test/test.factor b/extra/builder/test/test.factor index f521af1b7c..c18395acc9 100644 --- a/extra/builder/test/test.factor +++ b/extra/builder/test/test.factor @@ -6,7 +6,7 @@ USING: kernel namespaces sequences assocs builder continuations prettyprint tools.browser tools.test - bootstrap.stage2 ; + bootstrap.stage2 benchmark ; IN: builder.test @@ -16,9 +16,12 @@ IN: builder.test : do-tests ( -- ) run-all-tests keys "../test-all-vocabs" [ . ] with-file-out ; +: do-benchmarks ( -- ) run-benchmarks "../benchmarks" [ . ] with-file-out ; + : do-all ( -- ) bootstrap-time get "../boot-time" [ . ] with-file-out [ do-load ] runtime "../load-time" [ . ] with-file-out - [ do-tests ] runtime "../test-time" [ . ] with-file-out ; + [ do-tests ] runtime "../test-time" [ . ] with-file-out + do-benchmarks ; MAIN: do-all \ No newline at end of file