Re: Testing utility

Paul Kienzle <[email protected]> Tue, 12 Jun 2007 23:09:42 -0400
Newsgroups gmane.comp.gnu.octave.sources
Message-ID <[email protected]>
On Jun 8, 2007, at 4:20 AM, David Bateman wrote:

> Olli Saarela wrote:
>> Hello,
>>
>> 'make check' is not necessarily available in a run-time environment. I
>> used the enclosed function when testing the MSCV distribution.
>>
>> Olli
> Yes but this will only check the tests that are in the m-files. There
> are many tests also embedded in the C++ source code that this will miss
> as the source is not on the path. It will also miss the octave/tests
> directory that includes many tests as well. Really the "make check" is
> for the builder of octave that has a built version of octave in its
> source tree...

It is easy to grab the C++ tests:

	for f in `find octave -name "*.cc" -print | xargs grep -l "^[%][!]"`; 
do
		out=${f##*/}
		grep "^[%][!]" $f > test_${out%.cc}.m
	done

If these were extracted and installed along with the tests in 
octave/test, then you could write testall using something like:

    fns_and_files=completion_matches('test_');
    files=regexp(fns_and_files,'[.]m$','lineanchors');
    for f = files, test('f'); endfor

Sorry, this is untested --- I don't have 2.9.x on my Mac.

- Paul