autotest with cmake update

This commit is contained in:
Fernando Cacciola
2008-03-06 16:50:44 +00:00
parent 7e46543cd2
commit 69e8d74d6c
6 changed files with 335 additions and 6 deletions
@@ -269,7 +269,7 @@ cd ${CGAL_BINARY_DIR}/test;
[ -n "${ULIMIT_OPTIONS}" ] && ulimit ${ULIMIT_OPTIONS};
nice ${NICE_OPTIONS} make ${MAKE_OPTS} -fmakefile2;
echo 'COLLECTING RESULTS';
./collect_cgal_testresults;
./collect_cgal_testresults_from_cmake;
echo 'COPYING RESULTS';
cp results_${CGAL_TESTER}_${2}.tar.gz results_${CGAL_TESTER}_${2}.txt ${CGAL_TEST_DIR};
echo 'REMOVING LOCAL_TEST_DIR';
@@ -513,6 +513,11 @@ setup_dirs_for_latest_in_server()
# dir for the actual release
CGAL_DIR=${CGAL_ROOT}/${CGAL_RELEASE_ID}
# check, if CGAL_DIR exists
if [ !-d ${CGAL_DIR} ]; then
error "directory ${CGAL_DIR} does not exist"
fi
# dir of the previous release
# HAS TO exist !
# (used to copy config/install files and evt. gmp stuff)
@@ -540,6 +545,11 @@ setup_dirs_for_latest_unzipped()
# dir for the actual release
CGAL_DIR=${CGAL_ROOT}/${CGAL_RELEASE_ID}
# check, if CGAL_DIR exists
if [ !-d ${CGAL_DIR} ]; then
error "directory ${CGAL_DIR} does not exist"
fi
# dir of the previous release
# HAS TO exist !
# (used to copy config/install files and evt. gmp stuff)
@@ -580,6 +590,7 @@ setup_dirs()
if [ ! -r ${LOGS_DIR} ]; then
mkdir $LOGS_DIR
fi
}
update_symlinks()
+155
View File
@@ -0,0 +1,155 @@
#! /bin/sh
#
# =============================================================================
# $URL: svn+ssh://fcacciola@scm.gforge.inria.fr/svn/cgal/trunk/Scripts/developer_scripts/create_cgal_test $
# $Id: create_cgal_test 36975 2007-03-09 22:52:40Z spion $
#
# author(s) : Wieger Wesselink, Geert-Jan Giezeman
#
# coordinator : Utrecht University
# =============================================================================
#
# This script creates a cgal_test_with_cmake script with entries for all .C and .cpp
# files in the current test directory.
VERSION=1.1
DO_RUN="y"
while [ $1 ]; do
case "$1" in
-h|-help|--h|--help)
echo 'Usage : create_cgal_test_with_cmake [--no-run]'
echo
echo ' --help : prints this usage help'
echo ' --no-run : produces a cgal_test_with_cmake script that only does compilation, no execution'
exit
;;
--no-run)
DO_RUN=""
shift; continue
;;
esac
done
header()
{
echo "#---------------------------------------------------------------------#"
echo "# $1"
echo "#---------------------------------------------------------------------#"
}
create_script()
{
echo "#! /bin/sh"
echo
echo "# This is a script for the CGAL test suite. Such a script must obey"
echo "# the following rules:"
echo "#"
echo "# - the name of the script is cgal_test_with_cmake"
echo "# - for every target two one line messages are written to the file 'error.txt'"
echo "# the first one indicates if the compilation was successful"
echo "# the second one indicates if the execution was successful"
echo "# if one of the two was not successful, the line should start with 'ERROR:'"
echo "# - running the script should not require any user interaction"
echo "# - the script should clean up object files and executables"
echo
echo "ERRORFILE=error.txt"
echo "DO_RUN=${DO_RUN}"
echo
header "configure"
echo
cat << EOF
configure()
{
echo "Configuring... "
CONFIGURED="y"
if eval 'cmake -DCGAL_DIR="\$CGAL_DIR" .' ; then
echo " succesful configuration" >> \$ERRORFILE
else
echo " ERROR: configuration" >> \$ERRORFILE
CONFIGURED=""
fi
}
EOF
header "compile_and_run <target>"
echo
cat << EOF
compile_and_run()
{
echo "Compiling \$1 ... "
SUCCES="y"
if eval 'make TESTSUITE_CXXFLAGS="\$TESTSUITE_CXXFLAGS" \\
TESTSUITE_LDFLAGS="\$TESTSUITE_LDFLAGS" -fMakefile \$1' ; then
echo " succesful compilation of \$1" >> \$ERRORFILE
else
echo " ERROR: compilation of \$1" >> \$ERRORFILE
SUCCES=""
fi
if [ -n "\$DO_RUN" ] ; then
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
fi
eval "make CGAL_MAKEFILE=\$CGAL_MAKEFILE clean > /dev/null 2>&1 "
}
EOF
header "remove the previous error file"
echo
echo "rm -f \$ERRORFILE"
echo "touch \$ERRORFILE"
echo
header "configure, compile and run the tests"
echo
echo "configure"
echo
cat << EOF
if [ \$# -ne 0 ] ; then
for file in \$* ; do
compile_and_run \$file
done
else
EOF
for file in `ls *.C *.cpp 2>/dev/null | sort` ; do
if [ -n "`grep '\<main\>' $file`" ] ; then
tmp=`basename $file .C`
tmp=`basename $tmp .cpp`
echo " compile_and_run $tmp"
fi
done
echo "fi"
}
echo "create_cgal_test_with_cmake version $VERSION"
if [ -f cgal_test_with_cmake ] ; then
echo "moving cgal_test_with_cmake to cgal_test_with_cmake.bak ..."
mv -f cgal_test_with_cmake cgal_test_with_cmake.bak
fi
create_script > cgal_test_with_cmake
chmod 755 cgal_test_with_cmake
echo "created cgal_test_with_cmake ..."
@@ -339,6 +339,15 @@ sub make_testscripts()
system("$DEVELSCRIPTSDIR/create_cgal_test") == 0 or die "Execution of $DEVELSCRIPTSDIR/create_cgal_test failed";
}
}
if ( ! -f 'cgal_test_with_cmake' ) {
$_ = $DIR;
# chomp;
if (/_Demo$/) {
system("$DEVELSCRIPTSDIR/create_cgal_test_with_cmake", "--no-run") == 0 or die "Execution of $DEVELSCRIPTSDIR/create_cgal_test_with_cmake --no-run failed";
} else {
system("$DEVELSCRIPTSDIR/create_cgal_test_with_cmake") == 0 or die "Execution of $DEVELSCRIPTSDIR/create_cgal_test_with_cmake failed";
}
}
chdir '..';
}
}