diff --git a/.gitattributes b/.gitattributes index f63f6d639e3..993f2fbb7df 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3758,6 +3758,7 @@ Surface_reconstruction_points_3/test/Surface_reconstruction_points_3/data/oni.pw Surface_reconstruction_points_3/test/Surface_reconstruction_points_3/data/robocat_deci.off -text svneol=unset#application/octet-stream Surface_reconstruction_points_3/test/Surface_reconstruction_points_3/data/sphere_20k.xyz -text Surface_reconstruction_points_3/test/Surface_reconstruction_points_3/poisson_reconstruction_test.cmd eol=lf +Testsuite/test/Testsuite/cgal_test_with_cmake eol=lf Testsuite/test/collect_cgal_testresults_from_cmake -text Testsuite/test/makefile2 -text Testsuite/test/run_testsuite_with_cmake -text diff --git a/Testsuite/dont_submit b/Testsuite/dont_submit new file mode 100644 index 00000000000..58d518b0e52 --- /dev/null +++ b/Testsuite/dont_submit @@ -0,0 +1 @@ +test/Testsuite diff --git a/Testsuite/test/Testsuite/cgal_test_with_cmake b/Testsuite/test/Testsuite/cgal_test_with_cmake new file mode 100755 index 00000000000..115386738e4 --- /dev/null +++ b/Testsuite/test/Testsuite/cgal_test_with_cmake @@ -0,0 +1,67 @@ +#! /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_with_cmake +# - 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 + DO_RUN=y + if [ -z "${MAKE_CMD}" ]; then + MAKE_CMD=make + fi + NEED_CLEAN= + +#---------------------------------------------------------------------# +# compile_and_run +#---------------------------------------------------------------------# + +compile_and_run() +{ + if [ -n "$DO_RUN" ] ; then + if true ; then + OUTPUTFILE=ProgramOutput.$1.$PLATFORM + rm -f $OUTPUTFILE + COMMAND="procbench -m" + echo "Executing $1 ... " + echo + ulimit -t 100 2> /dev/null + if eval $COMMAND > $OUTPUTFILE 2>&1 ; then + echo " successful execution of $1" >> $ERRORFILE + else + echo " ERROR: execution of $1" >> $ERRORFILE + fi + else + echo " ERROR: not executed $1" >> $ERRORFILE + fi + fi +} + +#---------------------------------------------------------------------# +# remove the previous error file +#---------------------------------------------------------------------# + +rm -f $ERRORFILE +touch $ERRORFILE + +#---------------------------------------------------------------------# +# configure, compile and run the tests +#---------------------------------------------------------------------# + +compile_and_run + +# +# The clean target generated by CMake under cygwin +# always fails for some reason +# +if [ -n "${NEED_CLEAN}" ]; then + if ! ( uname | grep -q "CYGWIN" ) ; then + ${MAKE_CMD} -fMakefile clean + fi +fi