update script generating test scripts to account for CGAL_DATA_DIR

This commit is contained in:
Sébastien Loriot 2021-02-04 09:36:52 +01:00
parent 5e4170bf15
commit 8094be45c9
1 changed files with 17 additions and 1 deletions

View File

@ -97,6 +97,22 @@ cat << EOF
compile_and_run()
{
if [ -z "\${CGAL_DATA_DIR}" ]; then
if [ -d ../../data ]; then
CGAL_DATA_DIR=../../data
else
if [ -d ../../../Data/data ]; then
CGAL_DATA_DIR=../../../Data/data
else
echo "ERROR: Cannot run test script, please set the variable CGAL_DATA_DIR"
exit 1
fi
fi
fi
echo "Runs will be using CGAL_DATA_DIR = \${CGAL_DATA_DIR}"
echo "Compiling \$1 ... "
SUCCESS="y"
@ -113,7 +129,7 @@ compile_and_run()
rm -f \$OUTPUTFILE
COMMAND="./\$1"
if [ -f \$1.cmd ] ; then
COMMAND="\$COMMAND \`cat \$1.cmd\`"
COMMAND="\$COMMAND \`envsubst < \$1.cmd\`"
fi
if [ -f \$1.cin ] ; then
COMMAND="cat \$1.cin | \$COMMAND"