[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #49507] test: allow unit tests to signal that
From: |
Mike Miller |
Subject: |
[Octave-bug-tracker] [bug #49507] test: allow unit tests to signal that a test is expected to fail based on arbitrary runtime check |
Date: |
Wed, 2 Nov 2016 01:17:51 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0 |
Follow-up Comment #1, bug #49507 (project octave):
As a first stab at a proposal, I think it would be nice to use a particular
error ID that is defined by Octave to be caught by the test function. A test
that needs to depend on some feature at runtime could do something like
%! if (! have_some_optional_feature ())
%! error ("Octave:test:expected-failure", ...
%! "error: some feature is missing, skipping test");
%! endif
This would require the test.m function to look for that particular error ID
(using lasterror, since we don't implement exception objects yet), and set
appropriate local variables to indicate that this is a skipped test.
This error ID would be documented and advertised so that Forge packages and
user code could also use this error ID to get the same results using test.
Other thoughts?
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?49507>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/