mirror of https://github.com/CGAL/cgal
97 lines
1.6 KiB
Bash
Executable File
97 lines
1.6 KiB
Bash
Executable File
#!/bin/sh
|
|
OUTPUTFILE=error.txt
|
|
|
|
use_purify=0
|
|
|
|
one_run()
|
|
{
|
|
goodresult=RESULT/${base}/`basename ${datafile}`
|
|
if "./${base}" < ${datafile} >output
|
|
then
|
|
if [ -r ${goodresult} ]
|
|
then
|
|
if cmp -s output ${goodresult}
|
|
then
|
|
succes=ja
|
|
else
|
|
succes=nee
|
|
fi
|
|
else
|
|
succes=ja
|
|
fi
|
|
else
|
|
succes=nee
|
|
fi
|
|
if [ ${succes} = ja ]
|
|
then
|
|
echo "${base} < ${datafile} succesful">> $OUTPUTFILE
|
|
else
|
|
echo "ERROR: ${base} < ${datafile} did not run well" >> $OUTPUTFILE
|
|
fi
|
|
}
|
|
|
|
make_and_execute()
|
|
{
|
|
if [ -r ii_files/${base}.ii.$1 ]
|
|
then
|
|
mv ii_files/${base}.ii.$1 ii_files/${base}.ii
|
|
fi
|
|
EXTRA_FLAGS="-DTESTR=$1"
|
|
export EXTRA_FLAGS
|
|
if make ${base} # 2>/dev/null
|
|
then
|
|
echo "compilation of ${file} with TESTR=$1 succeeded" >> $OUTPUTFILE
|
|
if [ -r ii_files/${base}.ii ]
|
|
then
|
|
mv ii_files/${base}.ii ii_files/${base}.ii.$1
|
|
fi
|
|
if [ ${use_purify} -eq 1 ]
|
|
then
|
|
purify -log-file="%v.$1.%p.plog" ${base}
|
|
mv ${base}.pure ${base}
|
|
fi
|
|
for datafile
|
|
in ${datafiles}
|
|
do
|
|
if [ -r ${datafile} ]
|
|
then
|
|
one_run
|
|
fi
|
|
done
|
|
else
|
|
echo "ERROR: compilation of ${file} with TESTR=$1 failed" >> $OUTPUTFILE
|
|
fi
|
|
rm -f ${base} ${base}.o
|
|
}
|
|
|
|
echo ${CGAL_LIB_DIR}
|
|
|
|
/bin/rm -f $OUTPUTFILE
|
|
touch $OUTPUTFILE
|
|
|
|
if [ $# -ne 0 ]
|
|
then
|
|
sourcefiles="$*"
|
|
else
|
|
sourcefiles="tst*.C"
|
|
fi
|
|
|
|
|
|
for file
|
|
in ${sourcefiles}
|
|
do
|
|
base=`basename ${file} .C`
|
|
datafiles="ls DATA/${base}/ix*"
|
|
if [ "${datafiles}" ]
|
|
then
|
|
make_and_execute 1;
|
|
fi
|
|
if [ "${datafiles}" ]
|
|
then
|
|
make_and_execute 2;
|
|
fi
|
|
done
|
|
|
|
|
|
|