octave-maintainers
[Top][All Lists]
Advanced

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

Re: automated (or otherwise) tests for graphics code?


From: David Bateman
Subject: Re: automated (or otherwise) tests for graphics code?
Date: Thu, 16 Oct 2008 20:59:06 +0100
User-agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724)

Ben Abbott wrote:
On Thursday, October 16, 2008, at 03:31PM, "John W. Eaton" <address@hidden> 
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.



--
David Bateman                                address@hidden
35 rue Gambetta                              +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE            +33 6 72 01 06 33 (Mob)


reply via email to

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