← Back to team overview

dolfin team mailing list archive

Re: test

 

Anders Logg <logg@xxxxxxxxx> writes:

> On Thu, Apr 03, 2008 at 07:48:45PM +0200, Ilmar Wilbers wrote:
>> Any suggestions on how to use the demos as tests? We need to remove the 
>  
> Don't know. Ola?

It would be fairly easy to do something like the following in plot.py
(untested).  Could of course be extended to actually make 'plot' save argument
to a File, and compare for regression testing.

__all__ = ['Viper', 'plot', 'update', 'interactive', 'save_plot']

if noninteractive_tests_running:
   def ignore(*args, **kwargs):
       pass
   for x in __all__:
       exec('%s = ignore' % x)
else:
    try:
        for x in __all__:
            exec ('from viper.viper_dolfin import %s' % x)
    except:
        def no_viper(*args, **kwargs):
            raise RuntimeError, "Unable to plot (Viper plotter not available)"
        for x in __all__:
            exec('%s = no_viper' % s)

-j.



Follow ups

References