Files
cantera/test_problems/python/runtest
Harry Moffat a2f06e41ce Currently, linux and MSVC are producing the same results on this test
problem. I changed runtest to substitute the right machine dependent
blessed file.
2004-08-27 20:21:48 +00:00

104 lines
2.5 KiB
Bash
Executable File

#!/bin/sh
#
#
temp_success="1"
/bin/rm -f diamond.csv flame1.csv flame1_blessed_tmp.csv \
flame1.out diamond.out flame1_test.out \
diamond_test.out
#################################################################
#
#################################################################
CANTERA_DATA=${CANTERA_DATA:=../../data/inputs}; export CANTERA_DATA
CANTERA_BIN=${CANTERA_BIN:=../../bin}
#
# Try to create a default python executable location if no
# argument to runtest is supplied.
#
if test -z $PYTHONHOME ; then
PYTHON_CMDA=python
else
PYTHON_CMDA=$PYTHONHOME/bin/python
fi
PYTHON_CMD=${PYTHON_CMDA:=$1}
$PYTHON_CMD ../../Cantera/python/examples/flame1.py > flame1.out
retnStat=$?
if [ $retnStat != "0" ]
then
temp_success="0"
echo "flame1.py returned with bad status, $retnStat, check output"
fi
$PYTHON_CMD ../../Cantera/python/examples/diamond.py > diamond.out
retnStat=$?
if [ $retnStat != "0" ]
then
temp_success="0"
echo "diamond.py returned with bad status, $retnStat, check output"
fi
#################################################################
#
#################################################################
#
# Machine dependent blessed file for now
#
/bin/cp flame1_blessed.csv flame1_blessed_tmp.csv
machType=`../../bin/get_arch`
#
# HKM 08/27/04:
# Currently, linux and MSVC are producing the same results.
#
if test x"$machType" = "xlinux" ; then
/bin/cp flame1_blessed_linux.csv flame1_blessed_tmp.csv
fi
if test x"$machType" = "xcygwin" ; then
/bin/cp flame1_blessed_linux.csv flame1_blessed_tmp.csv
fi
#
$CANTERA_BIN/csvdiff flame1.csv flame1_blessed_tmp.csv > flame1_test.out
retnStat=$?
if [ $retnStat = "1" ]
then
echo "successful csv comparison on flame1 test"
else
echo "unsuccessful csv comparison on flame1 test"
echo "FAILED" > csvCode.txt
temp_success="0"
fi
#################################################################
#
#################################################################
$CANTERA_BIN/csvdiff diamond.csv diamond_blessed.csv > diamond_test.out
retnStat=$?
if [ $retnStat = "1" ]
then
echo "successful csv comparison on diamond test"
if [ $temp_success = "1" ]
then
echo "PASSED" > csvCode.txt
fi
else
echo "unsuccessful csv comparison on diamond test"
echo "FAILED" > csvCode.txt
temp_success="0"
fi
if [ $temp_success = "1" ]
then
echo 'Python csv test PASSED!'
else
echo 'Python csv test FAILED!'
fi
#################################################################
#
#################################################################