From cfdaaec068901f3eab8483627bdf6cf717ff2879 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 2 Oct 2009 16:20:33 -0500 Subject: [PATCH] move verbose-tests? out of private, change decode-test word to set the verbose mode itself, use images.pam in images test vocabs --- basis/images/png/png-tests.factor | 4 +--- basis/images/testing/testing.factor | 12 +++++++----- basis/images/tiff/tiff-tests.factor | 4 +--- basis/tools/test/test.factor | 6 +++--- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/basis/images/png/png-tests.factor b/basis/images/png/png-tests.factor index a2bd3010a8..65503c4dbe 100755 --- a/basis/images/png/png-tests.factor +++ b/basis/images/png/png-tests.factor @@ -1,10 +1,8 @@ ! Copyright (C) 2009 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: images.png images.testing namespaces tools.test -tools.test.private ; +images.pam ; IN: images.png.tests -verbose-tests? off "vocab:images/testing/png/rgb.png" decode-test "vocab:images/testing/png/yin_yang.png" decode-test -verbose-tests? on diff --git a/basis/images/testing/testing.factor b/basis/images/testing/testing.factor index 55ac452938..7aba0ca8aa 100644 --- a/basis/images/testing/testing.factor +++ b/basis/images/testing/testing.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2009 Keith Lazuka. ! See http://factorcode.org/license.txt for BSD license. USING: fry images.loader io io.encodings.binary io.files -io.pathnames io.streams.byte-array kernel locals quotations -sequences tools.test ; +io.pathnames io.streams.byte-array kernel locals namespaces +quotations sequences tools.test ; IN: images.testing :: encode-test ( path image-class -- ) @@ -26,6 +26,8 @@ IN: images.testing PRIVATE> : decode-test ( path -- ) - [ load-image 1quotation ] - [ '[ _ pam-name load-image ] ] bi - unit-test ; + f verbose-tests? [ + [ load-image 1quotation ] + [ '[ _ pam-name load-image ] ] bi + unit-test + ] with-variable ; diff --git a/basis/images/tiff/tiff-tests.factor b/basis/images/tiff/tiff-tests.factor index 0dcdecb776..056ede350c 100755 --- a/basis/images/tiff/tiff-tests.factor +++ b/basis/images/tiff/tiff-tests.factor @@ -2,14 +2,12 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors images.testing images.tiff images.viewer io io.encodings.binary io.files namespaces sequences tools.test -tools.test.private ; +images.pam ; IN: images.tiff.tests -verbose-tests? off "vocab:images/testing/tiff/octagon.tiff" decode-test "vocab:images/testing/tiff/elephants.tiff" decode-test "vocab:images/testing/tiff/noise.tiff" decode-test "vocab:images/testing/tiff/alpha.tiff" decode-test "vocab:images/testing/tiff/color_spectrum.tiff" decode-test ! "vocab:images/testing/tiff/rgb.tiff" decode-test -verbose-tests? on diff --git a/basis/tools/test/test.factor b/basis/tools/test/test.factor index e8f325bb9d..097460837b 100644 --- a/basis/tools/test/test.factor +++ b/basis/tools/test/test.factor @@ -27,6 +27,9 @@ T{ error-type { quot [ test-failures get ] } } define-error-type +SYMBOL: verbose-tests? +t verbose-tests? set-global + ( error experiment file line# -- triple ) @@ -79,9 +82,6 @@ MACRO: ( word -- ) [ name>> experiment-title ] bi '[ _ ndup _ narray _ prefix ] ; -SYMBOL: verbose-tests? -t verbose-tests? set-global - : experiment. ( seq -- ) [ first write ": " write ] [ rest verbose-tests? get [ . ] [ short. ] if flush ] bi ;