#! /bin/sh # This is a script for running the Visibility_complex test suite. # # This script assumes that the CGAL_MAKEFILE environment variable is set #---------------------------------------------------------------------# # compile_and_run #---------------------------------------------------------------------# compile_and_run() { echo "Compiling $1 ... " if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE $1'; then echo " compilation of $1 succeeded" else echo " ERROR: compilation of $1 failed" exit 1 fi if [ -f $1 ] ; then OUTPUTFILE=$1.out rm -f $OUTPUTFILE COMMAND="./$1" # echo "Executing $1 ... " echo if eval 2>&1 $COMMAND > $OUTPUTFILE ; then echo " execution of $1 succeeded" else echo " ERROR: execution of $1 failed" exit 1 fi else echo " ERROR: could not execute $1" exit 1 fi eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null " } #---------------------------------------------------------------------# # compile and run the tests #---------------------------------------------------------------------# cd test_suite if [ $# -ne 0 ] ; then for file in $* ; do compile_and_run $file done else compile_and_run visibility_complex_polygon compile_and_run visibility_complex_segment compile_and_run shortest_path fi