1// Regression tests
2// ----------------
3
4// The tests are checked against reference values by "make check" in
5// each examples subdirectory
6
7// "ref.edp" contains all reference values and may be rebuilt with
8// "make Ref"
9
10// $Id$
11
12// The values tested here may not have a physical or mathematical
13// meaning. Their main property is to gather numerical values from the
14// whole domain, to be checked for consistency with previous runs.
15
16NoUseOfWait=true;
17int verbosityy=verbosity;
18
19dnl May write or read a reference file
20changequote([[,]])
21
22define(REFFILE,"ref.edp")
23ifdef([[ASSERT]],
24	include REFFILE;,
25	ofstream ref(REFFILE);)
26
27dnl $1=file name
28dnl $2=reference value (if there is one)
29dnl $3=precision of reference value (if there is one)
30dnl	or minimum absolute variation if $4 is defined
31dnl $4=maximum absolute variation (if defined)
32
33define(ONETEST,
34[[cout << "--------- file : $1.edp -----------------" << endl;
35verbosity=verbosityy;
36{
37	dnl Place the dash first to avoid any confusion with things like "a-z"
38	define([[TESTVAR]],TEST[[]]translit($1,-_,XX))
39	define([[REFVAR]],REF[[]]translit($1,-_,XX))
40	include "$1.edp";
41	ifelse($2,,,
42		[[real TESTVAR=$2;
43		ifdef([[ASSERT]],
44			cout<<"$1 reference value = "<<REFVAR
45				<<" test value ="<<TESTVAR<<endl;
46			ifelse($4,,
47				assert(TESTVAR<REFVAR*(1+$3));
48				assert(TESTVAR>REFVAR*(1-$3));,
49				assert(TESTVAR<REFVAR+$4);
50				assert(TESTVAR>REFVAR-$3);),
51			ref<<"real REFVAR="<<TESTVAR<<";"<<endl;)]])
52};
53]])
54