Tue 06 Dec 2016 03:05:35 AM UTC, comment #2:
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.
|