From b68e2a5005392f0f2e7dab17e6d994668b20bb99 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 22 Apr 2022 11:25:09 +0200 Subject: [PATCH] Fix run_testsuite_with_ctest on Cygwin --- Scripts/developer_scripts/run_testsuite_with_ctest | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Scripts/developer_scripts/run_testsuite_with_ctest b/Scripts/developer_scripts/run_testsuite_with_ctest index 637f86f6227..631195ac9b8 100644 --- a/Scripts/developer_scripts/run_testsuite_with_ctest +++ b/Scripts/developer_scripts/run_testsuite_with_ctest @@ -331,7 +331,11 @@ run_test_on_platform() if [ -n "${SCRIPTS_DIR}" ]; then touch ../../../../../.scm-branch fi - python3 ${CGAL_DIR}/${TESTSUITE_DIR}test/parse-ctest-dashboard-xml.py $CGAL_TESTER $PLATFORM + # The strange way to run the script is to avoid the error message: + # python3: can't open file '/cygdrive/c/CGAL_ROOT/CGAL-5.5-Ic-68/C:/CGAL_ROOT/CGAL-5.5-Ic-68/test/parse-ctest-dashboard-xml.py': [Errno 2] No such file or directory + # It seems Python 3.9 from Cygwin cannot understand the Windows paths, + # but its `open` function can. + python3 -c "exec(open(\"${CGAL_DIR}/${TESTSUITE_DIR}test/parse-ctest-dashboard-xml.py\").read())" $CGAL_TESTER $PLATFORM for file in $(ls|grep _Tests); do mv $file "$(echo "$file" | sed 's/_Tests//g')" @@ -343,7 +347,7 @@ run_test_on_platform() 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 + python3 -c "exec(open(\"${CGAL_DIR}/${TESTSUITE_DIR}test/post_process_ctest_results.py\").read())" 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