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

[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: Dan Sebald
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: Tue, 6 Dec 2016 03:05:35 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0

Follow-up Comment #2, bug #49507 (project octave):

I looked at test.m a bit.  I understand the proposal, but I'm not sure how
well that would work.  I suppose it is doable.  ID variable is not well
documented in the error() function, so I'm not sure if that is supposed to be
a printf ID (i.e., output) or an error type.  So, would test.m be looking for
a particular ID?  Or would it have to scan the error message for a word such
as "skip"?

Another thought is if the "testif" feature were slightly more robust, it might
cover everything needed.  For example, negation of test requirements and
evaluation of strings might provide everything needed.  For example, in a
related gnuplot issue for publish.tst, a solution might be:

%!testif {"!HAVE_OSMESA", "any(strcmp(available_graphics_toolkits,
'gnuplot')"}

which would check for HAVE_OSMESA defined to 0 in a slight variation of the
current test.m behavior, but also it would evaluate any string not of that
form.

In some sense it would be simpler if instead of the slightly complex code for
decomposing HAVE_OSMESA there were simply an Octave function called
HAVE('OSMESA') that basically does the same thing.  That would mean that there
is then no special consideration for HAVE_XYZ, e.g.,

%!testif {"!HAVE('OSMESA')", "any(strcmp(available_graphics_toolkits,
'gnuplot')"}

I would think this is a very straightforward modification of test.m.  Also
there doesn't seem to be but a dozen script files using the HAVE_XYZ syntax in
their tests?  Those could be modified easily with opening the file in an
editor and using FIND/REPLACE.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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