2011-02-16 09:46:28 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2011-02-21 20:45:51 +00:00
|
|
|
# Script to generate summary/advice based on the data in $GSTESTSUM
|
2011-02-16 09:46:28 +00:00
|
|
|
#
|
|
|
|
# Authors of individual testsuites may supply their own implementation
|
|
|
|
# of Summary.sh to be used if someone runs their test framework.
|
|
|
|
#
|
2011-02-21 20:45:51 +00:00
|
|
|
# The script may examine the contents of $GSTESTSUM (containing totals of
|
|
|
|
# each kind of test result) or $GSTESTLOG (the full testrun log) to decide
|
2011-02-16 09:46:28 +00:00
|
|
|
# what sort of summary to present.
|
|
|
|
#
|
2011-02-21 20:45:51 +00:00
|
|
|
# The script may also use the value of the $GSTESTMODE variable to decide
|
2011-02-16 09:46:28 +00:00
|
|
|
# what it does.
|
|
|
|
#
|
|
|
|
|
|
|
|
if [ "$GSTESTMODE" = "clean" ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2011-02-19 05:03:12 +00:00
|
|
|
# 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
|
|
|
|
}
|
|
|
|
|
2016-05-14 09:13:47 +00:00
|
|
|
if test -r "$GSTESTSUM"
|
|
|
|
then
|
|
|
|
present "$GSTESTSUM" "Failed set$" "Failed sets$" "Failed test$" "Failed tests$" "Failed build$" "Failed builds$" "Failed file$" "Failed files$"
|
|
|
|
if [ $? = 1 ]
|
2011-02-16 09:46:28 +00:00
|
|
|
then
|
2016-05-14 09:13:47 +00:00
|
|
|
echo "All OK!"
|
2011-02-16 09:46:28 +00:00
|
|
|
|
2016-05-14 09:13:47 +00:00
|
|
|
if present "$GSTESTSUM" "Dashed hope$" "Dashed hopes$"
|
|
|
|
then
|
|
|
|
echo
|
|
|
|
echo "But we were hoping that even more tests might have passed if"
|
|
|
|
echo "someone had added support for them to the package. If you"
|
|
|
|
echo "would like to help, please contact the package maintainer."
|
|
|
|
fi
|
2011-02-16 09:46:28 +00:00
|
|
|
|
2016-05-14 09:13:47 +00:00
|
|
|
if present "$GSTESTSUM" "Skipped set$" "Skipped sets$"
|
|
|
|
then
|
|
|
|
echo
|
|
|
|
echo "Even though no tests failed, we had to skip some testing"
|
|
|
|
echo "due to lack of support on your system. This might be because"
|
|
|
|
echo "some required software library was just not available when the"
|
|
|
|
echo "software was built (in which case you can install that library"
|
|
|
|
echo "and rebuild, then re-run the tests), or the required functions"
|
|
|
|
echo "may not be available on your operating system at all."
|
|
|
|
echo "Please see $GSTESTLOG for more detail."
|
|
|
|
echo "If you would like to contribute code to add the missing"
|
|
|
|
echo "functionality, please contact the package maintainer."
|
|
|
|
fi
|
2011-02-16 09:46:28 +00:00
|
|
|
|
2016-05-14 09:13:47 +00:00
|
|
|
else
|
|
|
|
if [ "$GSTESTMODE" = "failfast" ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
fi
|
2011-02-16 09:46:28 +00:00
|
|
|
|
2016-05-14 09:13:47 +00:00
|
|
|
if present "$GSTESTSUM" "Failed build$" "Failed build$"
|
|
|
|
then
|
|
|
|
echo
|
|
|
|
echo "Unfortunately we could not even compile all the test programs."
|
|
|
|
echo "This means that the test could not be run properly, and you need"
|
|
|
|
echo "to try to figure out why and fix it or ask for help."
|
|
|
|
fi
|
2011-02-16 09:46:28 +00:00
|
|
|
|
2016-05-14 09:13:47 +00:00
|
|
|
if present "$GSTESTSUM" "Failed file$" "Failed files$"
|
|
|
|
then
|
|
|
|
echo
|
|
|
|
echo "Some testing was abandoned when a test program aborted. This is"
|
|
|
|
echo "generally a severe problem and may mean that the package is"
|
|
|
|
echo "completely unusable. You need to try to fix this and, if it is"
|
|
|
|
echo "not due to some problem on your system, please help by submitting"
|
|
|
|
echo "a patch (or at least a bug report) to the package maintainer."
|
|
|
|
fi
|
2011-02-16 09:46:28 +00:00
|
|
|
|
2016-05-14 09:13:47 +00:00
|
|
|
if present "$GSTESTSUM" "Failed set$" "Failed sets$"
|
|
|
|
then
|
|
|
|
echo
|
|
|
|
echo "Some set of tests failed. This could well mean that a large"
|
|
|
|
echo "number of individual tests did not pass and that there are"
|
|
|
|
echo "severe problems in the software."
|
|
|
|
echo "Please submit a patch to fix the problem or send a bug report to"
|
|
|
|
echo "the package maintainer."
|
|
|
|
fi
|
2013-03-28 09:08:55 +00:00
|
|
|
|
2016-05-14 09:13:47 +00:00
|
|
|
if present "$GSTESTSUM" "Failed test$" "Failed tests$"
|
|
|
|
then
|
|
|
|
echo
|
|
|
|
echo "One or more tests failed. None of them should have."
|
|
|
|
echo "Please submit a patch to fix the problem or send a bug report to"
|
|
|
|
echo "the package maintainer."
|
|
|
|
fi
|
2011-02-16 09:46:28 +00:00
|
|
|
|
2016-05-14 09:13:47 +00:00
|
|
|
echo "Please see $GSTESTLOG for more detail."
|
|
|
|
fi
|
|
|
|
fi
|