octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #42150] [N, MAX] = test(...) always returns [0


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #42150] [N, MAX] = test(...) always returns [0, 0] if a test fails
Date: Wed, 23 Apr 2014 23:15:35 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36

Update of bug #42150 (project octave):

                  Status:                    None => Need Info              

    _______________________________________________________

Follow-up Comment #1:

Thanks for the report. I think you do misunderstand though. The first
paragraph of the help for test says:

> the tests are run interactively and stop
> after the first error is encountered.

It doesn't explicitly say this, but the return values seem to always be zero
if the test function is not run in "batch" mode, meaning you have given it a
file descriptor as the third argument. But since test stops on the first
failing test, there's no point in reporting the number of tests passed or the
total number, since it may not have run all of them.

If you want to run all tests in a function, try


octave:1> [n, max] = test ("myfunc", [], stdout)


It's a little clunky, but that forces it into batch mode and runs all tests,
not stopping at the first failure. Does that do what you want?

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?42150>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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