From octave-sources-request at bevo dot che dot wisc dot edu Sun Apr 16 09:18:39 2000 Subject: Re: test scripts From: etienne grossmann To: octave-sources at bevo dot che dot wisc dot edu CC: etienne at isr dot ist dot utl dot pt Date: Sun, 16 Apr 2000 15:23:22 +0100 (WEST) Hello, From: pkienzle at kienzle dot powernet dot co dot uk (Paul Kienzle) # # Hi! I've been toying with test scripts for the functions that I've been # writing. That way, when I go in and change things or add new features, I # can easily test if I've broken any existing features. More importantly, # if others modify my routines, they can easily test cases that they might # not have thought of. I quickly concluded that it would be best if the # test script is stored in the file itself. # # I wrote ftest, which extracts lines starting with ##! and # evaluates them with eval(). It doesn't cope with syntax errors # elegantly, but I wanted to throw it out there and get some feedback. # Sounds like a nice way of having the function and it's test suite in the same file. What version of octave do you use? With 2.1.19, I get : ====================================================================== c++ -c -I. -I.. -I../liboctave -I../src -I../libcruft/misc -I../glob -I../glob -DHAVE_CONFIG_H -mieee-fp -fno-rtti -fno-exceptions -fno-implicit-templates -g -O2 -Wall ./DLD-FUNCTIONS/ftest.cc ./DLD-FUNCTIONS/ftest.cc: In function `class octave_value_list Fftest(const octave_value_list &, int)': ./DLD-FUNCTIONS/ftest.cc:41: implicit declaration of function `int add_unwind_protect(...)' ./DLD-FUNCTIONS/ftest.cc:57: implicit declaration of function `int run_unwind_protect(...)' ./DLD-FUNCTIONS/ftest.cc:67: implicit declaration of function `int feval(...)' ./DLD-FUNCTIONS/ftest.cc:67: warning: cannot pass objects of type `octave_value' through `...' /usr/local/include/octave/oct-obj.h:173: `octave_value_list::octave_value_list(int)' is private ./DLD-FUNCTIONS/ftest.cc:67: within this context ./DLD-FUNCTIONS/ftest.cc:45: warning: `enum Fftest(const octave_value_list &, int)::STATE state' might be used uninitialized in this function make: *** [ftest.o] Error 1 ====================================================================== Cheers, Etienne ----------------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.che.wisc.edu/octave/octave.html How to fund new projects: http://www.che.wisc.edu/octave/funding.html Subscription information: http://www.che.wisc.edu/octave/archive.html -----------------------------------------------------------------------