Commit e35f814e authored by Daniel Wortmann's avatar Daniel Wortmann

Fixed bugs in test script. Some tests always passed. Removed non-ported test...

Fixed bugs in test script. Some tests always passed. Removed non-ported test for Slicing. Fixes #314
parent fb6f38aa
......@@ -142,6 +142,11 @@ sub test_grepnumber($$$$$){
print LOG "$1 == $value:";
if ($1=="") {
print LOG "failed\n";
return 1;
}
if (abs($1-$value)<$tol){
print LOG "ok\n";
return 0;
......@@ -169,6 +174,11 @@ sub test_grep_lastnumber($$$$$){
print LOG "$1 == $value:";
if ($1=="") {
print LOG "failed\n";
return 1;
}
if (abs($1-$value)<$tol){
print LOG "ok\n";
return 0;
......
......@@ -2,6 +2,7 @@ package judft_tests;
@EXPORT="";
use jt;
use List::Util qw(min);
#This runs a single test
sub execute_test($$$$){
......
......@@ -9,7 +9,7 @@ jt::testrun($executable,$workdir);
$result=jt::test_fileexists("$workdir/out");
$result+=min(jt::test_fileexists("$workdir/cdn1"),jt::test_fileexists("$workdir/cdn.hdf"));
$result+=jt::test_grepnumber("$workdir/out","total energy=",".*= *([^ ]*)",-2786.95650275,0.0001);
$result+=jt::test_grepnumber("$workdir/out","distance of charge densitie","2: *([^ ]*)",8.38435,0.001);
$result+=jt::test_grepnumber("$workdir/out","distance of charge densitie","2: *([^ ]*)",8.376682,0.001);
$result+=jt::test_grepnumber("$workdir/out","distance of spin densitie","2: *([^ ]*)",17.14035,0.001);
jt::stageresult($workdir,$result,"1");
......
......@@ -7,7 +7,7 @@ jt::testrun($executable,$workdir);
#now test output
$result=jt::test_fileexists("$workdir/out");
$result+=min(jt::test_fileexists("$workdir/cdn1"),jt::test_fileexists("$workdir/cdn.hdf"));
$result+=jt::test_grepnumber("$workdir/out","total energy=","= *([^ ]*)",-4205.211,0.001);
$result+=jt::test_grepnumber("$workdir/out","distance of charge densitie","1: *([^ ]*)",7.074325,0.0001);
$result+=jt::test_grepnumber("$workdir/out","total energy=","= *([^ ]*)",-4205.143,0.001);
$result+=jt::test_grepnumber("$workdir/out","distance of charge densitie","1: *([^ ]*)",7.609001,0.0001);
jt::stageresult($workdir,$result,"1");
......@@ -6,9 +6,11 @@ jt::copyfile("files/inp-2.xml","$workdir/inp.xml");
jt::testrun($executable,$workdir);
#now test output
$result+=min(jt::test_fileexists("$workdir/cdn_slice"),jt::test_fileexists("$workdir/cdn_slice.hdf"));
$result=min(jt::test_fileexists("$workdir/cdn_slice"),jt::test_fileexists("$workdir/cdn_slice.hdf"));
#now test output
$result=jt::test_fileexists("$workdir/slice.xsf");
$result+=jt::test_fileexists("$workdir/slice.xsf");
# unit cell
$result+=jt::test_grepexists("$workdir/slice.xsf",".0000000 11.36143");
$result+=jt::test_grepexists("$workdir/slice.xsf","1.93419");
......
......@@ -3,13 +3,13 @@ enable_testing()
set(SerialParallelTests CuBulkXML SiLOXML Fe_1lXML
CuBandXML CuDOSXML Fe_bctXML PTOXML Fe_1l_SOCXML
PTO-SOCXML Fe_bct_SOCXML Fe_fccXML GaAsMultiUForceXML
SiFilmPlotXML SiFilmSlicePlotXML CoMCDXML Fe_Kerker Fe_bct_LOXML
SiFilmPlotXML CoMCDXML Fe_Kerker Fe_bct_LOXML
FePt_film_SSFT FePt_film_SSFT_LO )
#Currently disabled Tests (Hybrid+Greenfct)
# SiHybridGammaNoInv SiHybrid8kpt_sym SiHybrid8kpt_nosym
# KClHybridPBE0 GaAsHybridPBE0 FeHybridPBE0
# Fe_bcc_GreensFunction Fe_1l_GreensFunction
# CoUnfold
# SiFilmSlicePlotXML CoUnfold
set(SerialOnlyTests )
set(InpgenTests Si_plain Si_plain_explicit Si_full_para)# Si_kpt Si_kden Si_round_trip)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment