Debian Codegraph @

etc/config/m4/regtests.m4

raw
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
16 NoUseOfWait=true;
17 int verbosityy=verbosity;
18
19 dnl May write or read a reference file
20 changequote([[,]])
21
22 define(REFFILE,"ref.edp")
23 ifdef([[ASSERT]],
24 include REFFILE;,
25 ofstream ref(REFFILE);)
26
27 dnl $1=file name
28 dnl $2=reference value (if there is one)
29 dnl $3=precision of reference value (if there is one)
30 dnl or minimum absolute variation if $4 is defined
31 dnl $4=maximum absolute variation (if defined)
32
33 define(ONETEST,
34 [[cout << "--------- file : $1.edp -----------------" << endl;
35 verbosity=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 ]])