automated (or otherwise) tests for graphics code?
Ben Abbott
bpabbott at mac.com
Thu Oct 16 15:13:06 CDT 2008
On Thursday, October 16, 2008, at 03:59PM, "David Bateman" <dbateman at dbateman.org> wrote:
>Ben Abbott wrote:
>> On Thursday, October 16, 2008, at 03:31PM, "John W. Eaton" <jwe at bevo.che.wisc.edu> wrote:
>>> On 16-Oct-2008, Ben Abbott wrote:
>>>
>>> | There have been some instances of coding errors respecting the
>>> | graphics sources recently. These bugs could be identified by running
>>> | tests/demos where no graphics are produced. Might the rundemos()
>>> | script be able to run in that way and be added to "make check"?
>>>
>>> If there are tests that can be done that don't require visual
>>> inspection, then please add them. But they should be done with
>>> %!test, %!assert, %!fail, etc., not %!demo.
>>>
>>> jwe
>>
>> hmmm, ok.
>>
>> What I was thinking of was a way to hide the figures and run the demos. Any "assert" would be superfluous.
>> For example, sombero.m might contain a test
>>
>> %!test
>> %! figure (1)
>> %! set (gcf, "visibility", "off")
>> %! sombrero
>> %! colorbar
>> %! shading interp
>> %! shading flat
>> %! shading facted
>> %! assert (true)
>>
>> That certainly is the kind of "test" that is usually done, as it is a like firing a gun into the darkness and hoping to hit the boogie man. While I hesitate to suggest such, I thought I'd mention it.
>>
>
>Such a test would at least prove that something was plotted and so would
>isolate some of the issues, so I'd say it was worth it. However, I'd say
>you need to restore the visibility property to its initial value before
>the final assert as otherwise future plots will disappear.
>
>D.
If the figure is closed before the assert, would that do the trick?
Ben
More information about the Octave-maintainers
mailing list