[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new style of tests
From: |
etienne grossmann |
Subject: |
Re: new style of tests |
Date: |
Sat, 29 Apr 2000 15:32:36 +0100 (WEST) |
Hello,
did I oversleep?
VVVVVVVVVV
Date: Tue, 2 May 2000 06:34:31 +0100 (BST)
From: address@hidden (Paul Kienzle)
# >One problem I see is that once an error occurs, the remaining tests
# >are skipped. That is probably OK when you are running tests
# >interactively, but for automated tests, it would be nice to keep going
# >with the next test.
# done. I added the notion of evaluation blocks, and they quickly
# evolved into something powerful.
# %! << code>>
# arbitrary code; if it calls error() or has syntax errors then test fails
# %! <<noisy code>>
# tests to run if 'verbose' or interactive; asks for keypress when done
# %! <<assert expression::answer>>
# if expression!=answer, then test fails and displays both
# %! <<usage name(args)>>
# if name(args); does NOT signal an error, then test fails
# %! <<error code>>
# if code does NOT signal an error, then test fails
# %! <<shared x,y,z>>
# variables shared between the evaluation contexts
# %! <<# whatever>>
# comment out the entire test
# I don't know about the syntax. It was pretty much the first thing that
# popped into my head. Unless the octave parser is trained to ignore these
# test blocks, then we are constrained to have some sort of comment character
# at the beginning of every line. Emacs support would be nice, but I'm not
# even going to consider that until the syntax has been vetted by a few
# others.
That looks quite flexible and powerful indeed. Note that anything
that can be parsed can be put after 'endfunction', in a source
file. Unparsable things cause a warningAnd maybe it isn't too hard to
have octave ignore everything (even unparsable things) after a
'endfunction' in a function. (perl ignores everything after a line
containing '__END__' or '__DATA__').
Cheers,
Etienne