move verbose-tests? out of private, change decode-test word to set the verbose mode itself, use images.pam in images test vocabs

db4
Doug Coleman 2009-10-02 16:20:33 -05:00
parent 7d005111a4
commit cfdaaec068
4 changed files with 12 additions and 14 deletions

View File

@ -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

View File

@ -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 ;

View File

@ -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

View File

@ -27,6 +27,9 @@ T{ error-type
{ quot [ test-failures get ] }
} define-error-type
SYMBOL: verbose-tests?
t verbose-tests? set-global
<PRIVATE
: <test-failure> ( error experiment file line# -- triple )
@ -79,9 +82,6 @@ MACRO: <experiment> ( 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 ;