diff options
author | Eric Covener <covener@apache.org> | 2023-03-19 21:04:00 +0000 |
---|---|---|
committer | Eric Covener <covener@apache.org> | 2023-03-19 21:04:00 +0000 |
commit | 6fc8b4288e8716a17b63d0f4993dba66032a3ff0 (patch) | |
tree | 002bcd92626038a20047370e8735f620a7a4ac3e /test/travis_run_linux.sh | |
parent | d49af21477de943ab51c05a75596ad3867680b3c (diff) | |
download | httpd-6fc8b4288e8716a17b63d0f4993dba66032a3ff0.tar.gz |
rerun failing tests with -v
Submitted by: covener
Github: closes #349
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908531 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/travis_run_linux.sh')
-rwxr-xr-x | test/travis_run_linux.sh | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/test/travis_run_linux.sh b/test/travis_run_linux.sh index 1dc64871d4..c2ae092954 100755 --- a/test/travis_run_linux.sh +++ b/test/travis_run_linux.sh @@ -119,14 +119,44 @@ if ! test -v SKIP_TESTING; then if ! test -v NO_TEST_FRAMEWORK; then if test -v WITH_TEST_SUITE; then - make check TESTS="${TESTS}" TEST_CONFIG="${TEST_ARGS}" - RV=$? + make check TESTS="${TESTS}" TEST_CONFIG="${TEST_ARGS}" | tee test.log + RV=${PIPESTATUS[0]} + # re-run failing tests with -v, avoiding set -e + if [ $RV -ne 0 ]; then + # mv test/perl-framework/t/logs/error_log test/perl-framework/t/logs/error_log_save + FAILERS="" + while read FAILER; do + FAILERS="$FAILERS $FAILER" + done < <(awk '/Failed:/{print $1}' test.log) + if [ -n "$FAILERS" ]; then + t/TEST -v $FAILERS || true + fi + # set -e would have killed us after the original t/TEST + rm -f test.log + # mv test/perl-framework/t/logs/error_log_save test/perl-framework/t/logs/error_log + false + fi else test -v TEST_INSTALL || make install pushd test/perl-framework perl Makefile.PL -apxs $PREFIX/bin/apxs - make test APACHE_TEST_EXTRA_ARGS="${TEST_ARGS} ${TESTS}" - RV=$? + make test APACHE_TEST_EXTRA_ARGS="${TEST_ARGS} ${TESTS}" | tee test.log + RV=${PIPESTATUS[0]} + # re-run failing tests with -v, avoiding set -e + if [ $RV -ne 0 ]; then + # mv t/logs/error_log t/logs/error_log_save + FAILERS="" + while read FAILER; do + FAILERS="$FAILERS $FAILER" + done < <(awk '/Failed:/{print $1}' test.log) + if [ -n "$FAILERS" ]; then + t/TEST -v $FAILERS || true + fi + # set -e would have killed us after the original t/TEST + rm -f test.log + # mv t/logs/error_log_save t/logs/error_log + false + fi popd fi |