Commit 419c2d58 authored by Jens Bröder's avatar Jens Bröder

added method to grep/detect errors and warnings for tests, and refined the last inpgen tests

parent 8859a340
......@@ -169,4 +169,23 @@ sub testresult($){
}
}
sub test_grep_error($){
my $file=shift;
my $error="juDFT-Error";
my $warning="juDFT-Warning";
print LOG "Checking for judft messages in $file:";
if (system("grep -q \"$error\" $file")==0){
my $message = `grep "Error message:" $file`;
print LOG "Found a juDFT-ERROR: $message\n";
return 1;
}elsif (system("grep -q \"$warning\" $file")==0){
print LOG "Found a juDFT-WARNING\n";
return 0;
}else{
print LOG "No error and no warning found\n";
return 0;
}
}
......@@ -2,10 +2,12 @@
jt::copyfile("files/inp_Si_para",$workdir);
jt::testrun("$executable < inp_Si_para",$workdir);
#jt::testrun("$executable < inp_Si_para",$workdir);
jt::testrun("$executable -explicit < inp_Si_para &>outshell ; cat outshell",$workdir);
$result=jt::test_grep_error("$workdir/outshell");
#now test output
$result=jt::test_fileexists("$workdir/inp.xml");
$result+=jt::test_fileexists("$workdir/inp.xml");
jt::stageresult($workdir,$result,"1");
......@@ -2,20 +2,22 @@
jt::copyfile("files/inp_Si_plain",$workdir);
jt::testrun("$executable < inp_Si_plain",$workdir);
#jt::testrun("$executable < inp_Si_plain &> outshell | cat outshell",$workdir);
jt::testrun("$executable < inp_Si_plain &>outshell ; cat outshell",$workdir);
$result=jt::test_grep_error("$workdir/outshell");
#now test if inp.xml file was produced and if it contains certain features.
$result=jt::test_fileexists("$workdir/inp.xml");
$result+=jt::test_grepexists("$workdir/inp.xml",'filename="sym.out"');
$result+=jt::test_grepexists("$workdir/inp.xml","relpos label=");
$result+=jt::test_fileexists("$workdir/inp.xml");
$result+=jt::test_grepexists("$workdir/inp.xml","sym.out");
$result+=jt::test_grepexists("$workdir/inp.xml","relPos label=");
#test interface, that all files are there. This lst should be complete
# notice there is per default no inp file also no kpts file and no enpara file
# also developers should be made aware if the interface is changed.
$result=jt::test_fileexists("$workdir/out");
$result=jt::test_fileexists("$workdir/FleurInputSchema.xsd");
$result=jt::test_fileexists("$workdir/struct.xcf");
$result=jt::test_fileexists("$workdir/sym.out");
$result+=jt::test_fileexists("$workdir/out");
$result+=jt::test_fileexists("$workdir/FleurInputSchema.xsd");
$result+=jt::test_fileexists("$workdir/sym.out");
jt::stageresult($workdir,$result,"1");
......@@ -2,10 +2,13 @@
jt::copyfile("files/inp_Si_plain",$workdir);
jt::testrun("$executable -explicit < inp_Si_plain",$workdir);
jt::testrun("$executable -explicit < inp_Si_plain &>outshell ; cat outshell",$workdir);
# test for errors and warnings
$result=jt::test_grep_error("$workdir/outshell");
#now test output
$result=jt::test_fileexists("$workdir/inp.xml");
$result+=jt::test_fileexists("$workdir/inp.xml");
jt::stageresult($workdir,$result,"1");
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