Merge pull request #3832 from maxGimeno/Testsuite_with_ctest-Get_back_the_blue_squares-GF

Testsuite with CMake: get Back the Blue Squares
This commit is contained in:
Laurent Rineau 2019-05-06 15:45:59 +02:00
commit 33a058c0f6
4 changed files with 121 additions and 31 deletions

View File

@ -23,7 +23,7 @@ export TAR="tar"
export GUNZIP="gunzip" export GUNZIP="gunzip"
export COMPRESSOR="gzip" export COMPRESSOR="gzip"
export CONSOLE_OUTPUT="y" export CONSOLE_OUTPUT="y"
export CGAL_ROOT=`pwd` export CGAL_HOME=`pwd`
export USE_TARGZ="n" export USE_TARGZ="n"
export USE_TARBZ="n" export USE_TARBZ="n"
export CGAL_RELEASE="" export CGAL_RELEASE=""
@ -121,7 +121,7 @@ get_cgal()
# ---------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------
unzip_cgal() unzip_cgal()
{ {
cd "${CGAL_ROOT}" cd "${CGAL_HOME}"
log "${ACTUAL_LOGFILE}" "unzipping CGAL" log "${ACTUAL_LOGFILE}" "unzipping CGAL"
if [ "${USE_TARGZ}" = "y" ]; then if [ "${USE_TARGZ}" = "y" ]; then
@ -140,18 +140,18 @@ unzip_cgal()
fi fi
# check, if CGAL_DIR exists # check, if CGAL_DIR exists
if [ -d "${CGAL_ROOT}/${CGAL_RELEASE_ID}" ]; then if [ -d "${CGAL_HOME}/${CGAL_RELEASE_ID}" ]; then
# Reset CGAL-I symlink # Reset CGAL-I symlink
log "${ACTUAL_LOGFILE}" "Resetting CGAL-I symlink to ${CGAL_ROOT}/${CGAL_RELEASE_ID}" log "${ACTUAL_LOGFILE}" "Resetting CGAL-I symlink to ${CGAL_HOME}/${CGAL_RELEASE_ID}"
rm -f CGAL-I rm -f CGAL-I
ln -s "${CGAL_ROOT}/${CGAL_RELEASE_ID}" CGAL-I ln -s "${CGAL_HOME}/${CGAL_RELEASE_ID}" CGAL-I
# Reset CGAL-3.x-I symlink # Reset CGAL-3.x-I symlink
CGAL_RELEASE=`echo "${CGAL_RELEASE_ID}" | sed 's/I\([^-]*\)-.*/I\1/'` CGAL_RELEASE=`echo "${CGAL_RELEASE_ID}" | sed 's/I\([^-]*\)-.*/I\1/'`
log "${ACTUAL_LOGFILE}" "Resetting ${CGAL_RELEASE} symlink to ${CGAL_ROOT}/${CGAL_RELEASE_ID}" log "${ACTUAL_LOGFILE}" "Resetting ${CGAL_RELEASE} symlink to ${CGAL_HOME}/${CGAL_RELEASE_ID}"
rm -f "${CGAL_RELEASE}" rm -f "${CGAL_RELEASE}"
ln -s "${CGAL_ROOT}/${CGAL_RELEASE_ID}" "${CGAL_RELEASE}" ln -s "${CGAL_HOME}/${CGAL_RELEASE_ID}" "${CGAL_RELEASE}"
else else
error "directory ${CGAL_ROOT}/${CGAL_RELEASE_ID} does not exist" error "directory ${CGAL_HOME}/${CGAL_RELEASE_ID} does not exist"
fi fi
log_done "${ACTUAL_LOGFILE}" log_done "${ACTUAL_LOGFILE}"
@ -195,30 +195,30 @@ do
esac esac
done done
# Load settings # Load settings
if [ -f "$CGAL_ROOT/.autocgalrc" ]; then if [ -f "${CGAL_HOME}/.autocgalrc" ]; then
. "$CGAL_ROOT/.autocgalrc" . "${CGAL_HOME}/.autocgalrc"
else else
echo "CONFIGURATION FILE .autocgalrc NOT FOUND" >&2; echo "CONFIGURATION FILE .autocgalrc NOT FOUND" >&2;
exit 1 exit 1
fi fi
if [ -n "${SCRIPTS_DIR}" ]; then if [ -n "${SCRIPTS_DIR}" ]; then
CGAL_DIR=`readlink "${CGAL_ROOT}/CGAL-git"` CGAL_DIR=`readlink "${CGAL_HOME}/CGAL-git"`
else else
CGAL_DIR=`readlink "${CGAL_ROOT}/CGAL-I"` CGAL_DIR=`readlink "${CGAL_HOME}/CGAL-I"`
fi fi
source "${CGAL_DIR}/${SCRIPTS_DIR}developer_scripts/log.sh" source "${CGAL_DIR}/${SCRIPTS_DIR}developer_scripts/log.sh"
LOGS_DIR="${CGAL_ROOT}/AUTOTEST_LOGS" LOGS_DIR="${CGAL_HOME}/AUTOTEST_LOGS"
LOCK_FILE="${CGAL_ROOT}/autotest_cgal_with_cmake.lock" LOCK_FILE="${CGAL_HOME}/autotest_cgal_with_cmake.lock"
# Setup logfile # Setup logfile
ACTUAL_LOGFILE="${CGAL_ROOT}/`basename ${0}`.log" ACTUAL_LOGFILE="${CGAL_HOME}/`basename ${0}`.log"
rm -f "${ACTUAL_LOGFILE}" rm -f "${ACTUAL_LOGFILE}"
echo "Running `basename ${0}` "'$Revision$' >> "${ACTUAL_LOGFILE}" echo "Running `basename ${0}` "'$Revision$' >> "${ACTUAL_LOGFILE}"
cd "$CGAL_ROOT" cd "$CGAL_HOME"
# Starts the process # Starts the process
@ -232,9 +232,9 @@ if [ -z "${USE_LATEST_UNZIPPED}" -a -z "${SCRIPTS_DIR}" ]; then
fi fi
#reset CGAL-DIR with the updated CGAL-I #reset CGAL-DIR with the updated CGAL-I
if [ -n "${SCRIPTS_DIR}" ]; then if [ -n "${SCRIPTS_DIR}" ]; then
CGAL_DIR=`readlink "${CGAL_ROOT}/CGAL-git"` CGAL_DIR=`readlink "${CGAL_HOME}/CGAL-git"`
else else
CGAL_DIR=`readlink "${CGAL_ROOT}/CGAL-I"` CGAL_DIR=`readlink "${CGAL_HOME}/CGAL-I"`
fi fi
CGAL_RELEASE_ID=$(cat last_release_id) CGAL_RELEASE_ID=$(cat last_release_id)
@ -257,7 +257,7 @@ for HOST in ${BUILD_HOSTS}; do
echo "export GUNZIP=$GUNZIP">> env.sh echo "export GUNZIP=$GUNZIP">> env.sh
echo "export COMPRESSOR=$COMPRESSOR">> env.sh echo "export COMPRESSOR=$COMPRESSOR">> env.sh
echo "export CONSOLE_OUTPUT=$CONSOLE_OUTPUT">> env.sh echo "export CONSOLE_OUTPUT=$CONSOLE_OUTPUT">> env.sh
echo "export CGAL_ROOT=/cgal_root">> env.sh echo "export CGAL_HOME=/cgal_root">> env.sh
echo "export USE_TARGZ=$USE_TARGZ">> env.sh echo "export USE_TARGZ=$USE_TARGZ">> env.sh
echo "export USE_TARBZ=$USE_TARBZ">> env.sh echo "export USE_TARBZ=$USE_TARBZ">> env.sh
echo "export CGAL_RELEASE=$CGAL_RELEASE">> env.sh echo "export CGAL_RELEASE=$CGAL_RELEASE">> env.sh
@ -272,17 +272,17 @@ for HOST in ${BUILD_HOSTS}; do
docker pull cgal/testsuite-docker:debian-stable-cross-compilation-for-arm docker pull cgal/testsuite-docker:debian-stable-cross-compilation-for-arm
if [ -z "${SCRIPTS_DIR}" ]; then #if not from branch if [ -z "${SCRIPTS_DIR}" ]; then #if not from branch
echo "export CGAL_DIR=/cgal_root/\${CGAL_LAST}">>env.sh echo "export CGAL_DIR=/cgal_root/\${CGAL_LAST}">>env.sh
docker run --rm -t -e CGAL_LAST="${CGAL_RELEASE_ID}" -e HOST="${HOST}" -v ${CGAL_ROOT}/ssh:/tmp_ssh -v ${DEPS_DIR}:/deps -v ${CGAL_ROOT}:/cgal_root cgal/testsuite-docker:debian-stable-cross-compilation-for-arm docker run --rm -t -e CGAL_LAST="${CGAL_RELEASE_ID}" -e HOST="${HOST}" -v ${CGAL_HOME}/ssh:/tmp_ssh -v ${DEPS_DIR}:/deps -v ${CGAL_HOME}:/cgal_root cgal/testsuite-docker:debian-stable-cross-compilation-for-arm
else else
echo "export CGAL_DIR=/cgal_root/CGAL-git">>env.sh echo "export CGAL_DIR=/cgal_root/CGAL-git">>env.sh
docker run --rm -t -e HOST="${HOST}" -v ${CGAL_ROOT}/ssh:/tmp_ssh -v ${DEPS_DIR}:/deps -v ${CGAL_ROOT}:/cgal_root -v${CGAL_DIR}:/cgal_root/CGAL-git cgal/testsuite-docker:debian-stable-cross-compilation-for-arm docker run --rm -t -e HOST="${HOST}" -v ${CGAL_HOME}/ssh:/tmp_ssh -v ${DEPS_DIR}:/deps -v ${CGAL_HOME}:/cgal_root -v${CGAL_DIR}:/cgal_root/CGAL-git cgal/testsuite-docker:debian-stable-cross-compilation-for-arm
fi fi
else else
HOST=$HOST bash -$- ${CGAL_DIR}/${SCRIPTS_DIR}developer_scripts/run_testsuite_with_cmake HOST=$HOST bash -$- ${CGAL_DIR}/${SCRIPTS_DIR}developer_scripts/run_testsuite_with_ctest
fi fi
done done
cd "${CGAL_ROOT}" cd "${CGAL_HOME}"
if [ -e "LATEST" ]; then if [ -e "LATEST" ]; then
mv LATEST RELEASE_NR mv LATEST RELEASE_NR
fi fi

View File

@ -7,8 +7,8 @@
source "${CGAL_DIR}/${SCRIPTS_DIR}developer_scripts/log.sh" source "${CGAL_DIR}/${SCRIPTS_DIR}developer_scripts/log.sh"
# Load settings # Load settings
if [ -f "$CGAL_ROOT/.autocgalrc" ]; then if [ -f "${CGAL_HOME}/.autocgalrc" ]; then
. "$CGAL_ROOT/.autocgalrc" . "${CGAL_HOME}/.autocgalrc"
else else
echo "CONFIGURATION FILE .autocgalrc NOT FOUND" >&2; echo "CONFIGURATION FILE .autocgalrc NOT FOUND" >&2;
exit 1 exit 1
@ -255,7 +255,7 @@ run_test_on_platform()
CGAL_BINARY_DIR=${CGAL_BINARY_DIR_BASE}/${PLATFORM} CGAL_BINARY_DIR=${CGAL_BINARY_DIR_BASE}/${PLATFORM}
cd "${CGAL_BINARY_DIR}" cd "${CGAL_BINARY_DIR}"
log "${ACTUAL_LOGFILE}.test.${PLATFORM}" "Testing on host ${HOST} and platform ${PLATFORM}" log "${ACTUAL_LOGFILE}.test.${PLATFORM}" "Testing on host ${HOST} and platform ${PLATFORM}"
INIT_FILE="${CGAL_ROOT}/${REFERENCE_PLATFORMS_DIR}/${PLATFORM}.cmake" INIT_FILE="${CGAL_HOME}/${REFERENCE_PLATFORMS_DIR}/${PLATFORM}.cmake"
if [ ! -f "${INIT_FILE}" ]; then if [ ! -f "${INIT_FILE}" ]; then
echo "error NEED A INIT FILE !" echo "error NEED A INIT FILE !"
fi fi
@ -266,11 +266,11 @@ run_test_on_platform()
CMAKE_OPTS="${CMAKE_OPTS} -DWITH_examples=ON -DWITH_demos=ON" CMAKE_OPTS="${CMAKE_OPTS} -DWITH_examples=ON -DWITH_demos=ON"
fi fi
if [ -z "${SHOW_PROGRESS}" ]; then if [ -z "${SHOW_PROGRESS}" ]; then
cmake ${INIT_FILE:+"-C${INIT_FILE}"} '${CMAKE_GENERATOR}' -DBUILD_TESTING=ON ${CMAKE_OPTS} $CGAL_DIR 2>&1 >package_installation.log cmake ${INIT_FILE:+"-C${INIT_FILE}"} '${CMAKE_GENERATOR}' -DBUILD_TESTING=ON ${CMAKE_OPTS} $CGAL_DIR >package_installation.log 2>&1
else else
cmake ${INIT_FILE:+"-C${INIT_FILE}"} '${CMAKE_GENERATOR}' -DBUILD_TESTING=ON ${CMAKE_OPTS} $CGAL_DIR 2>&1 |tee package_installation.log cmake ${INIT_FILE:+"-C${INIT_FILE}"} '${CMAKE_GENERATOR}' -DBUILD_TESTING=ON ${CMAKE_OPTS} $CGAL_DIR 2>&1 |tee package_installation.log
fi fi
LIST_TEST_FILE="${CGAL_ROOT}/list_test_packages" LIST_TEST_FILE="${CGAL_HOME}/list_test_packages"
if [ -f ${LIST_TEST_FILE} ]; then if [ -f ${LIST_TEST_FILE} ]; then
LIST_TEST_PACKAGES=$(source ${LIST_TEST_FILE}) LIST_TEST_PACKAGES=$(source ${LIST_TEST_FILE})
fi fi
@ -283,11 +283,13 @@ run_test_on_platform()
TO_TEST="${TO_TEST}|$pkg" TO_TEST="${TO_TEST}|$pkg"
fi fi
done done
#unsets the limit of 1024 bits for the logs through ssh
echo "SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000000)" > CTestCustom.cmake
echo "SET(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 1000000000)" >> CTestCustom.cmake
CTEST_OPTS="-T Start -T Test -j${NUMBER_OF_PROCESSORS} ${DO_NOT_TEST:+-E execution___of__} --timeout 1200" CTEST_OPTS="-T Start -T Test -j${NUMBER_OF_PROCESSORS} ${DO_NOT_TEST:+-E execution___of__} --timeout 1200"
if [ -z "${SHOW_PROGRESS}" ]; then if [ -z "${SHOW_PROGRESS}" ]; then
ctest ${TO_TEST:+-L ${TO_TEST} } ${CTEST_OPTS} ${KEEP_TESTS:+-FC .}> tmp.txt ctest ${TO_TEST:+-L ${TO_TEST} } ${CTEST_OPTS} ${KEEP_TESTS:+-FC .}> tmp.txt
else else
echo "ctest ${CTEST_OPTS} ${TO_TEST:+-L ${TO_TEST}} ${KEEP_TESTS:+-FC .}|tee tmp.txt"
ctest ${CTEST_OPTS} ${TO_TEST:+-L ${TO_TEST}} ${KEEP_TESTS:+-FC .}|tee tmp.txt ctest ${CTEST_OPTS} ${TO_TEST:+-L ${TO_TEST}} ${KEEP_TESTS:+-FC .}|tee tmp.txt
fi fi
##################### #####################
@ -310,6 +312,10 @@ run_test_on_platform()
echo "CGAL_TEST_PLATFORM ${PLATFORM}" >> "$RESULT_FILE" echo "CGAL_TEST_PLATFORM ${PLATFORM}" >> "$RESULT_FILE"
grep -e "^-- USING " "${CGAL_BINARY_DIR}/installation.log" >> $RESULT_FILE grep -e "^-- USING " "${CGAL_BINARY_DIR}/installation.log" >> $RESULT_FILE
echo "------------" >> "$RESULT_FILE" echo "------------" >> "$RESULT_FILE"
#if git branch, create empty scm file for python script
if [ -n "${SCRIPTS_DIR}" ]; then
touch ../../../../../.scm-branch
fi
python3 ${CGAL_DIR}/${TESTSUITE_DIR}test/parse-ctest-dashboard-xml.py $CGAL_TESTER $PLATFORM python3 ${CGAL_DIR}/${TESTSUITE_DIR}test/parse-ctest-dashboard-xml.py $CGAL_TESTER $PLATFORM
for file in $(ls|grep _Tests); do for file in $(ls|grep _Tests); do
@ -319,9 +325,14 @@ run_test_on_platform()
TEST_REPORT="TestReport_${CGAL_TESTER}_${PLATFORM}" TEST_REPORT="TestReport_${CGAL_TESTER}_${PLATFORM}"
mkdir -p Installation mkdir -p Installation
chmod 777 Installation chmod 777 Installation
cp "${CGAL_BINARY_DIR}/package_installation.log" "Installation/${TEST_REPORT}" cat "${CGAL_BINARY_DIR}/package_installation.log" >> "Installation/${TEST_REPORT}"
#call the python script to complete the results report.
python3 ${CGAL_DIR}/${TESTSUITE_DIR}test/post_process_ctest_results.py Installation/${TEST_REPORT} ${TEST_REPORT} results_${CGAL_TESTER}_${PLATFORM}.txt
rm -f $OUTPUT_FILE $OUTPUT_FILE.gz rm -f $OUTPUT_FILE $OUTPUT_FILE.gz
if [ -n "${SCRIPTS_DIR}" ]; then
rm ../../../../../.scm-branch
fi
tar cf $OUTPUT_FILE results_${CGAL_TESTER}_${PLATFORM}.txt */"$TEST_REPORT" tar cf $OUTPUT_FILE results_${CGAL_TESTER}_${PLATFORM}.txt */"$TEST_REPORT"
echo echo
gzip -9f $OUTPUT_FILE gzip -9f $OUTPUT_FILE

View File

@ -100,11 +100,13 @@ for label, tests in tests_per_label.items():
tester=tester_name, tester=tester_name,
platform=platform_name), 'w') as label_report: platform=platform_name), 'w') as label_report:
print(""" print("""
{scm_branch}
------------------------------------------------------------------ ------------------------------------------------------------------
- Error output from platform {platform} - Error output from platform {platform}
------------------------------------------------------------------ ------------------------------------------------------------------
{error_txt} {error_txt}
""" .format(platform=platform_name, """ .format(scm_branch=open("{}/../../../../../.scm-branch".format(os.getcwd()), 'r').read(),
platform=platform_name,
error_txt=open("{}/error.txt".format(label), 'r').read()), file=label_report) error_txt=open("{}/error.txt".format(label), 'r').read()), file=label_report)
for t in tests: for t in tests:
filename="{}/ProgramOutput.{}".format(label, t['Name']) filename="{}/ProgramOutput.{}".format(label, t['Name'])

View File

@ -0,0 +1,77 @@
import sys
import io
import re
import os
report_file=sys.argv[1]
report_name=sys.argv[2]
global_report_name=sys.argv[3]
rx=re.compile('(.*Configuring (examples|demo|test)*( in )*(test\/|examples\/|demo\/)*)((?!done)\w+)')
rx_demo=re.compile('.*in demo\/')
rx_examples=re.compile('.*in examples\/')
#open the Installation report
#For each NAME, check if NAME is a directory. If not, create one, create a
#text report, and write everything that is in the report until the next NAME
#in it. Then, add 'NAME r' in the global report. This should allow to get all
#the NOTICE and other info explaining why the configuration is skiped.
name=""
is_writing=False
is_ignored=False
global_report=open(global_report_name, "a+")
with open(report_file, "rt") as test_report:
for myline in test_report:
m=rx.match(myline)
if is_writing:
if m:
is_writing=False
test_report.close()
if is_ignored:
print("{label} {result}".format(label=name, result='r'), file=global_report)
is_ignored=False
else:
test_report.write(myline)
if not is_writing:
if m:
name=m.group(0).replace(m.group(1), "")
if rx_demo.match(myline):
name="{str}_Demo".format(str=name)
elif rx_examples.match(myline):
name="{str}_Examples".format(str=name)
elif name == "libCGAL":
name="libCGAL_shared"
elif name == "libCGAL_Core":
name="libCGALCore_shared"
elif name == "libCGAL_ImageIO":
name="libCGALimageIO_shared"
elif name == "libCGAL_Qt5":
name="libCGALQt5_shared"
elif name == "Mesh_3_implicit_functions":
name="Polyhedron_Demo"
if name=="incomplete":
is_writing=False
is_ignored=False
continue
else:
if not os.path.isdir(name):
is_ignored=True
os.mkdir(name)
test_report=open("{dir}/{file}".format(dir=name, file=report_name), "w+")
print("""
{scm_branch}
""" .format(scm_branch=open("{}/../../../../../.scm-branch".format(os.getcwd()), 'r').read()),file=test_report)
else:
is_ignored=False
test_report=open("{dir}/{file}".format(dir=name, file=report_name), "a+")
test_report.write(" --- CMake Results: --- \n\n")
is_writing=True
if is_writing:
is_writing=False
test_report.close()
if is_ignored:
print("{label} {result}".format(label=name, result='r'), file=global_report)
is_ignored=False
global_report.close()