octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Questions about testing


From: Robert T. Short
Subject: Re: Questions about testing
Date: Mon, 15 Jun 2009 12:36:50 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.21) Gecko/20090402 SeaMonkey/1.1.16

Thanks.  I thought that was the case, even down to the DejaGnu stuff.

I just hate to write some dozens of tests and find out it did it wrong.

Bob


David Bateman wrote:
Robert T. Short wrote:
Bob has some questions. This is regarding the tests in the tests directory. Mostly I think it is pretty straightforward, but just to make sure I understand.

Most but not all of the files in the test directory have a series of entries of the form

%% test/octave.test/transpose/transpose-1.m
%!test
%! scalar = 2;
%! assert(scalar',2);

Question 1.

What does the first line

%% test/octave.test/transpose/transpose-1.m
The octave test system used to be under DejaGnu, but that instantiated a new instance of Octave for every test. The advantage of that is that even tests that core-dumped octave would stop the other tests running. But the penalty in time is too high when we have a few thousand tests. Most of the scripts in this directory were converted to the new test scheme a few years ago with a lot of nasty scripts and for historical reasons I kept the old DejaGnu filename as a comment.. A few years down the track with DejaGnu buried these lines no longer make sense and should probably go.

do?  I don't find a file anywhere called transpose-1.m

Question 2.

Does the %! have some special significance, or does it just indicate that the embedded code is to be executed as part of the test?
Yes the "%!" anywhere is a file of any sort as the first two characters on a line will cause the Octave test harness to treat the following lines as a test function.. A lot of the m-files and C++ files are sprinkled with such lines.


Question 3.

What does the

%!test

line do?
See the manual

http://www.gnu.org/software/octave/doc/interpreter/Test-and-Demo-Functions.html

D.


Bob
--
Robert T. Short
PhaseLocked Systems








reply via email to

[Prev in Thread] Current Thread [Next in Thread]