diff --git a/Scripts/developer_scripts/autotest_cgal_with_ctest b/Scripts/developer_scripts/autotest_cgal_with_ctest index cd954740e7d..84e9664889f 100755 --- a/Scripts/developer_scripts/autotest_cgal_with_ctest +++ b/Scripts/developer_scripts/autotest_cgal_with_ctest @@ -23,7 +23,7 @@ export TAR="tar" export GUNZIP="gunzip" export COMPRESSOR="gzip" export CONSOLE_OUTPUT="y" -export CGAL_ROOT=`pwd` +export CGAL_HOME=`pwd` export USE_TARGZ="n" export USE_TARBZ="n" export CGAL_RELEASE="" @@ -121,7 +121,7 @@ get_cgal() # ---------------------------------------------------------------------------------------- unzip_cgal() { - cd "${CGAL_ROOT}" + cd "${CGAL_HOME}" log "${ACTUAL_LOGFILE}" "unzipping CGAL" if [ "${USE_TARGZ}" = "y" ]; then @@ -140,18 +140,18 @@ unzip_cgal() fi # 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 - 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 - ln -s "${CGAL_ROOT}/${CGAL_RELEASE_ID}" CGAL-I + ln -s "${CGAL_HOME}/${CGAL_RELEASE_ID}" CGAL-I # Reset CGAL-3.x-I symlink 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}" - ln -s "${CGAL_ROOT}/${CGAL_RELEASE_ID}" "${CGAL_RELEASE}" + ln -s "${CGAL_HOME}/${CGAL_RELEASE_ID}" "${CGAL_RELEASE}" else - error "directory ${CGAL_ROOT}/${CGAL_RELEASE_ID} does not exist" + error "directory ${CGAL_HOME}/${CGAL_RELEASE_ID} does not exist" fi log_done "${ACTUAL_LOGFILE}" @@ -195,30 +195,30 @@ do esac done # Load settings -if [ -f "$CGAL_ROOT/.autocgalrc" ]; then - . "$CGAL_ROOT/.autocgalrc" +if [ -f "${CGAL_HOME}/.autocgalrc" ]; then + . "${CGAL_HOME}/.autocgalrc" else echo "CONFIGURATION FILE .autocgalrc NOT FOUND" >&2; exit 1 fi if [ -n "${SCRIPTS_DIR}" ]; then - CGAL_DIR=`readlink "${CGAL_ROOT}/CGAL-git"` + CGAL_DIR=`readlink "${CGAL_HOME}/CGAL-git"` else - CGAL_DIR=`readlink "${CGAL_ROOT}/CGAL-I"` + CGAL_DIR=`readlink "${CGAL_HOME}/CGAL-I"` fi source "${CGAL_DIR}/${SCRIPTS_DIR}developer_scripts/log.sh" -LOGS_DIR="${CGAL_ROOT}/AUTOTEST_LOGS" -LOCK_FILE="${CGAL_ROOT}/autotest_cgal_with_cmake.lock" +LOGS_DIR="${CGAL_HOME}/AUTOTEST_LOGS" +LOCK_FILE="${CGAL_HOME}/autotest_cgal_with_cmake.lock" # Setup logfile -ACTUAL_LOGFILE="${CGAL_ROOT}/`basename ${0}`.log" +ACTUAL_LOGFILE="${CGAL_HOME}/`basename ${0}`.log" rm -f "${ACTUAL_LOGFILE}" echo "Running `basename ${0}` "'$Revision$' >> "${ACTUAL_LOGFILE}" -cd "$CGAL_ROOT" +cd "$CGAL_HOME" # Starts the process @@ -232,9 +232,9 @@ if [ -z "${USE_LATEST_UNZIPPED}" -a -z "${SCRIPTS_DIR}" ]; then fi #reset CGAL-DIR with the updated CGAL-I if [ -n "${SCRIPTS_DIR}" ]; then - CGAL_DIR=`readlink "${CGAL_ROOT}/CGAL-git"` + CGAL_DIR=`readlink "${CGAL_HOME}/CGAL-git"` else - CGAL_DIR=`readlink "${CGAL_ROOT}/CGAL-I"` + CGAL_DIR=`readlink "${CGAL_HOME}/CGAL-I"` fi 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 COMPRESSOR=$COMPRESSOR">> 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_TARBZ=$USE_TARBZ">> 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 if [ -z "${SCRIPTS_DIR}" ]; then #if not from branch 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 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 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 done -cd "${CGAL_ROOT}" +cd "${CGAL_HOME}" if [ -e "LATEST" ]; then mv LATEST RELEASE_NR fi diff --git a/Scripts/developer_scripts/run_testsuite_with_cmake b/Scripts/developer_scripts/run_testsuite_with_ctest similarity index 92% rename from Scripts/developer_scripts/run_testsuite_with_cmake rename to Scripts/developer_scripts/run_testsuite_with_ctest index 26cb5cc0593..26a8ed972bb 100644 --- a/Scripts/developer_scripts/run_testsuite_with_cmake +++ b/Scripts/developer_scripts/run_testsuite_with_ctest @@ -7,8 +7,8 @@ source "${CGAL_DIR}/${SCRIPTS_DIR}developer_scripts/log.sh" # Load settings -if [ -f "$CGAL_ROOT/.autocgalrc" ]; then - . "$CGAL_ROOT/.autocgalrc" +if [ -f "${CGAL_HOME}/.autocgalrc" ]; then + . "${CGAL_HOME}/.autocgalrc" else echo "CONFIGURATION FILE .autocgalrc NOT FOUND" >&2; exit 1 @@ -255,7 +255,7 @@ run_test_on_platform() CGAL_BINARY_DIR=${CGAL_BINARY_DIR_BASE}/${PLATFORM} cd "${CGAL_BINARY_DIR}" 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 echo "error NEED A INIT FILE !" fi @@ -266,11 +266,11 @@ run_test_on_platform() CMAKE_OPTS="${CMAKE_OPTS} -DWITH_examples=ON -DWITH_demos=ON" fi 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 cmake ${INIT_FILE:+"-C${INIT_FILE}"} '${CMAKE_GENERATOR}' -DBUILD_TESTING=ON ${CMAKE_OPTS} $CGAL_DIR 2>&1 |tee package_installation.log fi - LIST_TEST_FILE="${CGAL_ROOT}/list_test_packages" + LIST_TEST_FILE="${CGAL_HOME}/list_test_packages" if [ -f ${LIST_TEST_FILE} ]; then LIST_TEST_PACKAGES=$(source ${LIST_TEST_FILE}) fi @@ -283,11 +283,13 @@ run_test_on_platform() TO_TEST="${TO_TEST}|$pkg" fi 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" if [ -z "${SHOW_PROGRESS}" ]; then ctest ${TO_TEST:+-L ${TO_TEST} } ${CTEST_OPTS} ${KEEP_TESTS:+-FC .}> tmp.txt 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 fi ##################### @@ -310,6 +312,10 @@ run_test_on_platform() echo "CGAL_TEST_PLATFORM ${PLATFORM}" >> "$RESULT_FILE" grep -e "^-- USING " "${CGAL_BINARY_DIR}/installation.log" >> $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 for file in $(ls|grep _Tests); do @@ -319,9 +325,14 @@ run_test_on_platform() TEST_REPORT="TestReport_${CGAL_TESTER}_${PLATFORM}" mkdir -p 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 + if [ -n "${SCRIPTS_DIR}" ]; then + rm ../../../../../.scm-branch + fi tar cf $OUTPUT_FILE results_${CGAL_TESTER}_${PLATFORM}.txt */"$TEST_REPORT" echo gzip -9f $OUTPUT_FILE diff --git a/Testsuite/test/parse-ctest-dashboard-xml.py b/Testsuite/test/parse-ctest-dashboard-xml.py index b197db9997c..6258d56babe 100644 --- a/Testsuite/test/parse-ctest-dashboard-xml.py +++ b/Testsuite/test/parse-ctest-dashboard-xml.py @@ -100,11 +100,13 @@ for label, tests in tests_per_label.items(): tester=tester_name, platform=platform_name), 'w') as label_report: print(""" +{scm_branch} ------------------------------------------------------------------ - Error output from platform {platform} ------------------------------------------------------------------ {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) for t in tests: filename="{}/ProgramOutput.{}".format(label, t['Name']) diff --git a/Testsuite/test/post_process_ctest_results.py b/Testsuite/test/post_process_ctest_results.py new file mode 100644 index 00000000000..ff81668fb35 --- /dev/null +++ b/Testsuite/test/post_process_ctest_results.py @@ -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()