Skip to content

Commit

Permalink
(#450; #449) added automated test that ./phantom file.in succeeds aft…
Browse files Browse the repository at this point in the history
…er completing phantomsetup
  • Loading branch information
danieljprice committed Jul 6, 2023
1 parent ff937aa commit c8dbfeb
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions scripts/buildbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ check_phantomsetup ()
myfail=0;
setup=$1;
if [ -e ./bin/phantomsetup ]; then
print_result "exists" $pass;
print_result "phantomsetup exists" $pass;
else
print_result "FAIL: phantomsetup does not exist" $fail;
myfail=$(( myfail + 1 ));
Expand All @@ -178,6 +178,9 @@ check_phantomsetup ()
mkdir $dirname;
cd /tmp/$dirname;
cp $phantomdir/bin/phantomsetup .;
#
# run ./phantomsetup prefix, answering any questions with "Enter"
#
myinput="\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
prefix="myrun";
echo -e "$myinput" > myinput.txt;
Expand All @@ -189,15 +192,51 @@ check_phantomsetup ()
print_result "FAIL: requires input other than 'Enter'" $fail;
myfail=$(( myfail + 1 ));
fi
#
# run phantomsetup up to 3 times to successfully create/rewrite the .setup file
#
./phantomsetup $prefix < myinput.txt > /dev/null;
./phantomsetup $prefix < myinput.txt > /dev/null;
if [ -e "$prefix.setup" ]; then
print_result "creates .setup file" $pass;
else
print_result "no .setup file" $warn;
fi
if [ -e "$prefix.in" ]; then
infile="${prefix}.in"
if [ -e "$infile" ]; then
print_result "creates .in file" $pass;
#
# if creating the .in file succeeds, try to run phantom
# on the .in file with nmax=0
#
if [ -e $phantomdir/bin/phantom ]; then
print_result "phantom exists" $pass;
cp $phantomdir/bin/phantom .;
#
# set nmax=0 in the .in file
#
sed -i .bak 's/nmax = .*/nmax = 0/g' "$prefix.in"
#
# run phantom on the .in file
#
./phantom $infile > /dev/null; err=$?;
if [ $err -eq 0 ]; then
print_result "./phantom $infile runs ok" $pass;
dumpfile="${prefix}_00000"
if [ -s $dumpfile ]; then
print_result "${dumpfile} successfully created" $pass;
else
print_result "FAIL: did not create ${dumpfile}" $fail;
myfail=$(( myfail + 1 ));
fi
else
print_result "FAIL: ./phantom $infile fails with error" $fail;
myfail=$(( myfail + 1 ));
fi
else
print_result "FAIL: phantom does not exist" $fail;
myfail=$(( myfail + 1 ));
fi
else
print_result "FAILED to create .in file after 3 attempts" $fail;
myfail=$(( myfail + 1 ));
Expand Down Expand Up @@ -400,6 +439,9 @@ for setup in $listofsetups; do
echo "<td>$htext</td>" >> $htmlfile;
fi
if [ "X$target" == "Xsetup" ] && [ "X$component" == "Xsetup" ]; then
# also build phantom main binary
echo "compiling phantom with SETUP=$setup"
make SETUP=$setup $nolibs $mynowarn $maxp $mydebug 1>> $makeout 2>> $errorlog; err=$?;
check_phantomsetup $setup;
elif [ "X$target" == "Xanalysis" ] && [ "X$component" == "Xanalysis" ]; then
check_phantomanalysis $setup;
Expand Down

0 comments on commit c8dbfeb

Please sign in to comment.