]> gitweb.factorcode.org Git - factor.git/commitdiff
benchmark: wrap the error in <test-failure>
authorBjörn Lindqvist <bjourne@gmail.com>
Thu, 17 Dec 2015 17:57:52 +0000 (18:57 +0100)
committerBjörn Lindqvist <bjourne@gmail.com>
Thu, 17 Dec 2015 18:03:59 +0000 (19:03 +0100)
Piggybacks on the test-failure error. word so that we get a traceback if
an error occurs during benchmarking. To make it easier to debug the "No
suitable arithmetic method" random error #1484

extra/benchmark/benchmark.factor

index 3f4a87405480c0206b78dfefcfd12871728d4294..9016d3444946e2b4c3e80c78ef3b601451afafc7 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays assocs continuations debugger formatting fry help.markup
 io io.styles kernel math memory prettyprint sequences
-tools.profiler.sampling tools.time vocabs.hierarchy vocabs.loader ;
+tools.profiler.sampling tools.test tools.time vocabs.hierarchy vocabs.loader ;
 IN: benchmark
 
 : run-timing-benchmark ( vocab -- time )
@@ -20,7 +20,9 @@ IN: benchmark
     "=== %s\n" printf ;
 
 : run-benchmark ( vocab quot: ( vocab -- res ) -- result ok? )
-    over write-header '[ _ @ t ] [ f ] recover ; inline
+    over write-header '[ _ @ t ] [
+        f f f <test-failure> f
+    ] recover ; inline
 
 PRIVATE>