improve checks for internal failures

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@32213 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-02-19 05:03:12 +00:00
parent e8d115f59b
commit abdddb1b70
3 changed files with 44 additions and 24 deletions

View file

@ -18,13 +18,29 @@ then
exit 0
fi
grep "\(Failed set\|Failed sets\|Failed test\|Failed tests\|Failed build\|Failed build\|Failed file\|Failed files\)$" tests.sum >/dev/null
# Function for platforms where grep can't search for multiple patterns.
present()
{
f=$1
shift
while test $# != 0
do
grep "$1" "$f" >/dev/null
if [ $? = "0" ]
then
return 0
fi
shift
done
return 1
}
present "tests.sum" "Failed set$" "Failed sets$" "Failed test$" "Failed tests$" "Failed build$" "Failed builds$" "Failed file$" "Failed files$" "Failed script$" "Failed scripts$"
if [ $? = 1 ]
then
echo "All OK!"
grep "\(Dashed hope\|Dashed hopes\)$" tests.sum >/dev/null
if [ $? = 0 ]
if present "tests.sum" "Dashed hope$" "Dashed hopes$"
then
echo
echo "But we were hoping that even more tests might have passed if"
@ -32,8 +48,7 @@ then
echo "would like to help, please contact the package maintainer."
fi
grep "\(Skipped set\|Skipped sets\)$" tests.sum >/dev/null
if [ $? = 0 ]
if present "tests.sum" "Skipped set$" "Skipped sets$"
then
echo
echo "Even though no tests failed, we had to skip some testing"
@ -52,8 +67,16 @@ else
exit 0
fi
grep "\(Failed build\|Failed build\)$" tests.sum >/dev/null
if [ $? = 0 ]
if present "tests.sum" "Failed script$" "Failed script$"
then
echo
echo "Unfortunately the script to build and run the tests did not work."
echo "This means that there is a problem with the test framework itsself"
echo "probably due to some system specific problems with the shell"
echo "or a problem wiith the installation of the test framework."
fi
if present "tests.sum" "Failed build$" "Failed build$"
then
echo
echo "Unfortunately we could not even compile all the test programs."
@ -61,8 +84,7 @@ else
echo "to try to figure out why and fix it or ask for help."
fi
grep "\(Failed file\|Failed files\)$" tests.sum >/dev/null
if [ $? = 0 ]
if present "tests.sum" "Failed file$" "Failed files$"
then
echo
echo "Some testing was abandoned when a test program aborted. This is"
@ -72,8 +94,7 @@ else
echo "a patch (or at least a bug report) to the package maintainer."
fi
grep "\(Failed set\|Failed sets\)$" tests.sum >/dev/null
if [ $? = 0 ]
if present "tests.sum" "Failed set$" "Failed sets$"
then
echo
echo "Some set of tests failed. This could well mean that a large"
@ -83,8 +104,7 @@ else
echo "the package maintainer."
fi
grep "\(Failed test\|Failed tests\)$" tests.sum >/dev/null
if [ $? = 0 ]
if present "tests.sum" "Failed test$" "Failed tests$"
then
echo
echo "One or more tests failed. None of them should have."

View file

@ -211,24 +211,24 @@ run_test_file ()
export GSTESTMODE
$RUNCMD $run_args $TESTFILE > $CWD/tests.tmp 2>&1
RUNEXIT=$?
if [ "$RUNEXIT" = "1" ]
if [ "$RUNEXIT" != "0" -a "$RUNEXIT" != "999" ]
then
echo "Failed file: $TESTFILE" >> $CWD/tests.tmp
echo "Failed script: $TESTFILE" >> $CWD/tests.tmp
fi
# Add the information to the detailed log.
cat $CWD/tests.tmp >> $CWD/tests.log
# Extract the summary information and add it to the summary file.
extract $CWD/tests.tmp "^Passed test:" "^Failed test:" "^Failed build:" "^Completed file:" "^Failed file:" "^Dashed hope:" "^Failed set:" "^Skipped set:" > $CWD/tests.sum.tmp
extract $CWD/tests.tmp "^Passed test:" "^Failed test:" "^Failed build:" "^Completed file:" "^Failed file:" "^Failed script:" "^Dashed hope:" "^Failed set:" "^Skipped set:" > $CWD/tests.sum.tmp
cat $CWD/tests.sum.tmp >> $CWD/tests.sum
# If there were failures or unresolved tests then report them...
if present $CWD/tests.sum.tmp "^Failed build:" "^Failed file:" "^Failed set:" "^Failed test:"
if present $CWD/tests.sum.tmp "^Failed script:" "^Failed build:" "^Failed file:" "^Failed set:" "^Failed test:"
then
echo
echo $TESTFILE:
extract $CWD/tests.sum.tmp "^Failed build:" "^Failed file:" "^Failed set:" "^Failed test:"
extract $CWD/tests.sum.tmp "^Failed script:" "^Failed build:" "^Failed file:" "^Failed set:" "^Failed test:"
fi
fi
}
@ -321,7 +321,7 @@ else
# common (hopefully passes) output first.
# NB. we omit the 'Completed file' tests as uninteresting ... users
# generally only want to see the total pass count and any problems.
extract tests.sum "^Passed test:" "^Failed test:" "^Failed build:" "^Failed file:" "^Dashed hope:" "^Failed set:" "^Skipped set:" | cut -d: -f1 | sort | uniq -c | sed -e 's/.*/&s/' | sed -e 's/^\([^0-9]*1[^0-9].*\)s$/\1/' | sort -n -b -r > tests.tmp
extract tests.sum "^Passed test:" "^Failed test:" "^Failed script:" "^Failed build:" "^Failed file:" "^Dashed hope:" "^Failed set:" "^Skipped set:" | cut -d: -f1 | sort | uniq -c | sed -e 's/.*/&s/' | sed -e 's/^\([^0-9]*1[^0-9].*\)s$/\1/' | sort -n -b -r > tests.tmp
else
echo "No tests found." > tests.tmp
fi

View file

@ -168,7 +168,7 @@ then
then
mv GNUmakefile.bck GNUmakefile
fi
exit 1
exit 999
fi
else
# We want aggressive memory checking.
@ -192,9 +192,9 @@ then
then
if [ -r $NAME.abort ]
then
echo "Completed file: $1" >&2
echo "Completed file: $1" >&2
else
echo "Failed file: $1 aborted without running all tests!" >&2
echo "Failed file: $1 aborted without running all tests!" >&2
if [ "$GSTESTMODE" = "failfast" ]
then
mv GNUmakefile GNUmakefile.tmp
@ -202,11 +202,11 @@ then
then
mv GNUmakefile.bck GNUmakefile
fi
exit 1
exit 999
fi
fi
else
echo "Completed file: $1" >&2
echo "Completed file: $1" >&2
fi
fi