regtests.m4

来自「FreeFem++可以生成高质量的有限元网格。可以用于流体力学」· M4 代码 · 共 54 行

M4
54
字号
// Regression tests// ----------------// The tests are checked against reference values by "make check" in// each examples subdirectory// "ref.edp" contains all reference values and may be rebuilt with// "make Ref"// $Id: regtests.m4,v 1.1 2004/09/07 08:37:27 lehyaric Exp $// The values tested here may not have a physical or mathematical// meaning. Their main property is to gather numerical values from the// whole domain, to be checked for consistency with previous runs.NoUseOfWait=true;int verbosityy=verbosity;dnl May write or read a reference filechangequote([[,]])define(REFFILE,"ref.edp")ifdef([[ASSERT]],	include REFFILE;,	ofstream ref(REFFILE);)dnl $1=file namednl $2=reference value (if there is one)dnl $3=precision of reference value (if there is one)dnl	or minimum absolute variation if $4 is defineddnl $4=maximum absolute variation (if defined)define(ONETEST,[[cout << "--------- file : $1.edp -----------------" << endl;verbosity=verbosityy;{	dnl Place the dash first to avoid any confusion with things like "a-z"	define([[TESTVAR]],TEST[[]]translit($1,-_,XX))	define([[REFVAR]],REF[[]]translit($1,-_,XX))	include "$1.edp";	ifelse($2,,,		[[real TESTVAR=$2;		ifdef([[ASSERT]],			cout<<"$1 reference value = "<<REFVAR				<<" test value ="<<TESTVAR<<endl;			ifelse($4,,				assert(TESTVAR<REFVAR*(1+$3));				assert(TESTVAR>REFVAR*(1-$3));,				assert(TESTVAR<REFVAR+$4);				assert(TESTVAR>REFVAR-$3);),			ref<<"real REFVAR="<<TESTVAR<<";"<<endl;)]])};]])

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?