Commit 52df9556 authored by Emmanuel Promayon's avatar Emmanuel Promayon

FIXED ctest --tests-regex (-R) argument required + improved log

parent db76075e
......@@ -35,7 +35,7 @@ fi
echo "===== Running ctest ====="
ctest -VV \
ctest --extra-verbose \
-DCTEST_SITE="$CDASH_SITE" \
-DCI_MODE="$CAMITK_CI_MODE" \
-DCI_ID="P $CI_PIPELINE_ID - J $CI_BUILD_ID" \
......@@ -51,7 +51,7 @@ ctest -VV \
# see https://gitlab.kitware.com/cmake/cmake/issues/17767
# and https://gitlab.kitware.com/cmake/cmake/issues/16314
# echo "===== Re-running failed tests ====="
# ctest -VV \
# ctest --extra-verbose \
# --rerun-failed \
# -DCTEST_SITE="$CDASH_SITE" \
# -DCI_MODE="$CAMITK_CI_MODE" \
......@@ -81,7 +81,7 @@ if grep --quiet "Fatal error" $CI_PROJECT_DIR/$PROJECT_LOG_DIR/ci-test.log; then
echo "===== Failed tests ====="
grep -e "\*\*\*Failed" -e "SegFault" $CI_PROJECT_DIR/$PROJECT_LOG_DIR/test.log
echo
echo "===== Re-run failed ====="
echo "===== Re-running failed tests ====="
echo "Checking $CI_PROJECT_DIR/$PROJECT_LOG_DIR/test.log for failed test" > ${PROJECT_LOG_DIR}/rerun-test.log
echo "" >> ${PROJECT_LOG_DIR}/rerun-test.log
# loop over failed
......@@ -93,7 +93,7 @@ if grep --quiet "Fatal error" $CI_PROJECT_DIR/$PROJECT_LOG_DIR/ci-test.log; then
echo "Reason:" >> ${PROJECT_LOG_DIR}/rerun-test.log
echo "$line" >> ${PROJECT_LOG_DIR}/rerun-test.log
echo "" >> ${PROJECT_LOG_DIR}/rerun-test.log
ctest -VV \
ctest --extra-verbose \
-DCTEST_SITE="$CDASH_SITE" \
-DCI_MODE="$CAMITK_CI_MODE" \
-DCI_ID="P $CI_PIPELINE_ID - J $CI_BUILD_ID" \
......@@ -102,12 +102,19 @@ if grep --quiet "Fatal error" $CI_PROJECT_DIR/$PROJECT_LOG_DIR/ci-test.log; then
-DCI_PROJECT_LOG_DIRECTORY="$CI_PROJECT_DIR/$PROJECT_LOG_DIR" \
-DCTEST_SOURCE_DIRECTORY="$PROJECT_SOURCE_DIR" \
-DCTEST_BINARY_DIRECTORY="$PROJECT_BUILD_DIR" \
$testname > >(tee --append ${PROJECT_LOG_DIR}/rerun-test.log | grep --line-buffered -e "Test \#") 2>&1
--tests-regex $testname > >(tee --append ${PROJECT_LOG_DIR}/rerun-test.log | grep --line-buffered -e "Test \#") 2>&1
done
if grep --quiet "\*\*\*Failed" -e "SegFault" $CI_PROJECT_DIR/$PROJECT_LOG_DIR/rerun-test.log; then
if grep --quiet "\*\*\*Failed" $CI_PROJECT_DIR/$PROJECT_LOG_DIR/rerun-test.log; then
echo
echo "===== Fatal errors in reran tests ====="
echo "Found fatal error in rerun test log $CI_PROJECT_DIR/$PROJECT_LOG_DIR/rerun-test.log"
echo
echo "===== Failed tests in reran tests ====="
grep -e "\*\*\*Failed" -e "SegFault" $CI_PROJECT_DIR/rerun-$PROJECT_LOG_DIR/test.log
echo
exit 1
else
echo "Re-run OK"
echo "Re-ran tests OK"
fi
else
echo "Everything OK. No test needed to be re-ran." > ${PROJECT_LOG_DIR}/rerun-test.log
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment