From 9336a18ee7b681906b25324b75b005ee90de489b Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 23 Feb 2007 13:23:53 +0000 Subject: [PATCH] temp. cgal_test modified to show why it fails --- .gitattributes | 1 + .../examples/Interpolation/cgal_test | 84 +++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100755 Interpolation/examples/Interpolation/cgal_test diff --git a/.gitattributes b/.gitattributes index 9262e74bbca..05b75ce926c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -684,6 +684,7 @@ Interpolation/doc_tex/Interpolation/nn_coords.gif -text svneol=unset#image/gif Interpolation/doc_tex/Interpolation/nn_coords.ipe -text svneol=unset#application/postscript Interpolation/doc_tex/Interpolation/nn_coords.pdf -text svneol=unset#application/pdf Interpolation/doc_tex/Interpolation/nn_coords.xml svneol=native#text/xml +Interpolation/examples/Interpolation/cgal_test eol=lf Intersections_2/test/Intersections_2/cgal_test eol=lf Intersections_3/test/Intersections_3/cgal_test eol=lf Jet_fitting_3/clean_tree.csh eol=lf diff --git a/Interpolation/examples/Interpolation/cgal_test b/Interpolation/examples/Interpolation/cgal_test new file mode 100755 index 00000000000..0a3ae3d175a --- /dev/null +++ b/Interpolation/examples/Interpolation/cgal_test @@ -0,0 +1,84 @@ +#! /bin/sh + +# This is a script for the CGAL test suite. Such a script must obey +# the following rules: +# +# - the name of the script is cgal_test +# - for every target two one line messages are written to the file 'error.txt' +# the first one indicates if the compilation was successful +# the second one indicates if the execution was successful +# if one of the two was not successful, the line should start with 'ERROR:' +# - running the script should not require any user interaction +# - the script should clean up object files and executables + +ERRORFILE=error.txt + +#---------------------------------------------------------------------# +# compile_and_run +#---------------------------------------------------------------------# + +compile_and_run() +{ + echo "Compiling $1 ... " + SUCCES="y" + if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \ + TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ + TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $1' ; then + echo " succesful compilation of $1" >> $ERRORFILE + else + echo " ERROR: compilation of $1" >> $ERRORFILE + SUCCES="" + fi + + if [ -n "${SUCCES}" ] ; then + OUTPUTFILE=ProgramOutput.$1.$PLATFORM + rm -f $OUTPUTFILE + COMMAND="./$1" + if [ -f $1.cmd ] ; then + COMMAND="$COMMAND `cat $1.cmd`" + fi + if [ -f $1.cin ] ; then + COMMAND="cat $1.cin | $COMMAND" + fi + echo "Executing $1 ... " + echo + ulimit -t 3600 2> /dev/null + if eval $COMMAND > $OUTPUTFILE 2>&1 ; then + echo " succesful execution of $1" >> $ERRORFILE + else + echo " ERROR: execution of $1" >> $ERRORFILE + fi + else + echo " ERROR: not executed $1" >> $ERRORFILE + fi + + eval "make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null 2>&1 " +} + +#---------------------------------------------------------------------# +# remove the previous error file +#---------------------------------------------------------------------# + +rm -f $ERRORFILE +touch $ERRORFILE + +#---------------------------------------------------------------------# +# compile and run the tests +#---------------------------------------------------------------------# + +if [ $# -ne 0 ] ; then + for file in $* ; do + compile_and_run $file + done +else + compile_and_run interpolation_2 + compile_and_run linear_interpolation_2 + compile_and_run nn_coordinates_2 + compile_and_run nn_coordinates_3 + compile_and_run rn_coordinates_2 + compile_and_run sibson_interpolation_2 + compile_and_run surface_neighbor_coordinates_3 +fi + +printf "Last exit code: %s\n" "$?" +echo "Hello world."