Skip to content

Commit

Permalink
1. Improve echo function in regression script
Browse files Browse the repository at this point in the history
2. Add return values in compare golden python script
  • Loading branch information
sdhzhs committed Jul 14, 2024
1 parent 02424a8 commit 8d77963
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 23 deletions.
8 changes: 4 additions & 4 deletions comgolden.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ def buildtoken(tokenlist):
aeroparagolden=[]
tokenlist=[]
buildtoken(tokenlist)
#filename='cases/Aeroreport.dat'
filename=sys.argv[1]+'/Aeroreport.dat'
readaeropara(filename,tokenlist,aeropara)
#filename='../2.2.10/ransfoil22-win64-binary/cases/Aeroreport.dat'
#filename='D:\\CaseFiles\\ransfoil\\relaxfactor\\Aeroreport_simple_ra0.7.dat'
filename=sys.argv[2]+'/Aeroreport.dat'
readaeropara(filename,tokenlist,aeroparagolden)
#for a in aeropara:
Expand All @@ -59,5 +56,8 @@ def buildtoken(tokenlist):
print("The relative error of",tokenlist[i],"with golden is",res)
else:
print("The relative error of",tokenlist[i-1],"with golden is",res)
if(flag):
if(flag):
print("The relative errors of all the aeropara with golden are smaller than",tol)
sys.exit(0)
else:
sys.exit(1)
88 changes: 69 additions & 19 deletions regtestfoil.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,83 @@
#!/bin/sh
mkdir naca0012_xyz
ransfoil --script test/ransfoil.config.0012.xyz
python comgolden.py naca0012_xyz golden/naca0012_xyz
ransfoil --script test/ransfoil.config.0012.xyz > naca0012_xyz/output.txt
python comgolden.py naca0012_xyz golden/naca0012_xyz >> naca0012_xyz/output.txt
if [ $? -eq 0 ]; then
echo "naca0012_xyz case: Pass"
else
echo "naca0012_xyz case: Fail"
fi
mkdir naca001264_cpt
ransfoil --script test/ransfoil.config.001264.cpt
python comgolden.py naca001264_cpt golden/naca001264_cpt
ransfoil --script test/ransfoil.config.001264.cpt > naca001264_cpt/output.txt
python comgolden.py naca001264_cpt golden/naca001264_cpt >> naca001264_cpt/output.txt
if [ $? -eq 0 ]; then
echo "naca001264_cpt case: Pass"
else
echo "naca001264_cpt case: Fail"
fi
mkdir GA_W-1_xyz
ransfoil --script test/ransfoil.config.GA_W-1.xyz
python comgolden.py GA_W-1_xyz golden/GA_W-1_xyz
ransfoil --script test/ransfoil.config.GA_W-1.xyz > GA_W-1_xyz/output.txt
python comgolden.py GA_W-1_xyz golden/GA_W-1_xyz >> GA_W-1_xyz/output.txt
if [ $? -eq 0 ]; then
echo "GA_W-1_xyz case: Pass"
else
echo "GA_W-1_xyz case: Fail"
fi
mkdir GA_W-1_cpt
ransfoil --script test/ransfoil.config.GA_W-1.cpt
python comgolden.py GA_W-1_cpt golden/GA_W-1_cpt
ransfoil --script test/ransfoil.config.GA_W-1.cpt > GA_W-1_cpt/output.txt
python comgolden.py GA_W-1_cpt golden/GA_W-1_cpt >> GA_W-1_cpt/output.txt
if [ $? -eq 0 ]; then
echo "GA_W-1_cpt case: Pass"
else
echo "GA_W-1_cpt case: Fail"
fi
mkdir whitcomb_xyz
ransfoil --script test/ransfoil.config.whitcomb.xyz.1
ransfoil --script test/ransfoil.config.whitcomb.xyz.2
python comgolden.py whitcomb_xyz golden/whitcomb_xyz
ransfoil --script test/ransfoil.config.whitcomb.xyz.1 > whitcomb_xyz/output.txt
ransfoil --script test/ransfoil.config.whitcomb.xyz.2 >> whitcomb_xyz/output.txt
python comgolden.py whitcomb_xyz golden/whitcomb_xyz >> whitcomb_xyz/output.txt
if [ $? -eq 0 ]; then
echo "whitcomb_xyz case: Pass"
else
echo "whitcomb_xyz case: Fail"
fi
mkdir whitcomb_cpt
ransfoil --script test/ransfoil.config.whitcomb.cpt.1
ransfoil --script test/ransfoil.config.whitcomb.cpt.2
python comgolden.py whitcomb_cpt golden/whitcomb_cpt
ransfoil --script test/ransfoil.config.whitcomb.cpt.1 > whitcomb_cpt/output.txt
ransfoil --script test/ransfoil.config.whitcomb.cpt.2 >> whitcomb_cpt/output.txt
python comgolden.py whitcomb_cpt golden/whitcomb_cpt >> whitcomb_cpt/output.txt
if [ $? -eq 0 ]; then
echo "whitcomb_cpt case: Pass"
else
echo "whitcomb_cpt case: Fail"
fi
mkdir goe495_cpt
ransfoil --script test/ransfoil.config.goe495.cpt
python comgolden.py goe495_cpt golden/goe495_cpt
ransfoil --script test/ransfoil.config.goe495.cpt > goe495_cpt/output.txt
python comgolden.py goe495_cpt golden/goe495_cpt >> goe495_cpt/output.txt
if [ $? -eq 0 ]; then
echo "goe495_cpt case: Pass"
else
echo "goe495_cpt case: Fail"
fi
cd scripts
./runwhitcomb.bat
python ../comgolden.py whitcomb1 ../golden/whitcomb_xyz_super
python ../comgolden.py whitcomb1 ../golden/whitcomb_xyz_super > 3.txt
if [ $? -eq 0 ]; then
echo "whitcomb_xyz_super case: Pass"
else
echo "whitcomb_xyz_super case: Fail"
fi
cd ../src
gfcompile.sh
./caller.exe
./caller.exe > output.txt
if [ $? -eq 0 ]; then
echo "fortran call lib case: Pass"
else
echo "fortran call lib case: Fail"
fi
gccompile.sh
./caller.exe
./caller.exe >> output.txt
if [ $? -eq 0 ]; then
echo "c call lib case: Pass"
else
echo "c call lib case: Fail"
fi
cd ..

0 comments on commit 8d77963

Please sign in to comment.