Rework test suite status reporting
Remove the timeout and the parallel tail call. Always output to standard error, for synchronization with the rest of the reporting.
This commit is contained in:
parent
5163dbee45
commit
5c2fe5cfb3
77
glibc.spec
77
glibc.spec
@ -1742,54 +1742,43 @@ truncate -s 0 $RPM_BUILD_ROOT/var/cache/ldconfig/aux-cache
|
|||||||
%check
|
%check
|
||||||
%if %{with testsuite}
|
%if %{with testsuite}
|
||||||
|
|
||||||
# Run the glibc tests. If any tests fail to build we exit %check with an error
|
# Run the glibc tests. If any tests fail to build we exit %check with
|
||||||
# of 1, otherwise we print the test failure list and the failed test output
|
# an error, otherwise we print the test failure list and the failed
|
||||||
# and exit with 0. In the future we want to compare against a baseline and
|
# test output and continue. Write to standard error to avoid
|
||||||
# exit with 1 if the results deviate from the baseline.
|
# synchronization issues with make and shell tracing output if
|
||||||
|
# standard output and standard error are different pipes.
|
||||||
run_tests () {
|
run_tests () {
|
||||||
truncate -s 0 check.log
|
# This hides a test suite build failure, which should be fatal. We
|
||||||
tail -f check.log &
|
# check "Summary of test results:" below to verify that all tests
|
||||||
tailpid=$!
|
# were built and run.
|
||||||
# Run the make a sub-shell (to avoid %check failing if make fails)
|
make %{?_smp_mflags} -O check |& tee rpmbuild.check.log >&2
|
||||||
# but capture the status for use later. We use the normal sub-shell
|
test -n tests.sum
|
||||||
# trick of printing the status. The actual result of the sub-shell
|
if ! grep -q '^Summary of test results:$' rpmbuild.check.log ; then
|
||||||
# is the successful execution of the echo.
|
echo "FAIL: test suite build of target: $(basename "$(pwd)")" >& 2
|
||||||
status=$(set +e
|
|
||||||
make %{?_smp_mflags} -O check > check.log 2>&1
|
|
||||||
status=$?
|
|
||||||
echo $status)
|
|
||||||
# Wait for the tail to catch up with the output and then kill it.
|
|
||||||
sleep 10
|
|
||||||
kill $tailpid
|
|
||||||
# Print the header, so we can find it, but skip the error printing
|
|
||||||
# if there aren't any failrues.
|
|
||||||
echo ===================FAILED TESTS=====================
|
|
||||||
if [ $status -ne 0 ]; then
|
|
||||||
# We are not running with `-k`, therefore a test build failure
|
|
||||||
# terminates the test run and that terminates %check with an
|
|
||||||
# error which terminates the build. We want this behaviour to
|
|
||||||
# ensure that all tests build, and all tests run.
|
|
||||||
# If the test result summary is not present it means one of
|
|
||||||
# tests failed to build.
|
|
||||||
if ! grep 'Summary of test results:' check.log; then
|
|
||||||
echo "FAIL: Some glibc tests failed to build."
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
set +x
|
||||||
# Print out information about all of the failed tests.
|
grep -v ^PASS: tests.sum > rpmbuild.tests.sum.not-passing || true
|
||||||
grep -e ^FAIL -e ^ERROR tests.sum \
|
if test -n rpmbuild.tests.sum.not-passing ; then
|
||||||
| awk '{print $2}' \
|
echo ===================FAILED TESTS===================== >&2
|
||||||
| while read testcase;
|
echo "Target: $(basename "$(pwd)")" >& 2
|
||||||
do
|
cat rpmbuild.tests.sum.not-passing >&2
|
||||||
echo "$testcase"
|
while read failed_code failed_test ; do
|
||||||
cat $testcase.out
|
for suffix in out test-result ; do
|
||||||
echo -------------------------
|
if test -e "$failed_test.$suffix"; then
|
||||||
|
echo >&2
|
||||||
|
echo "=====$failed_code $failed_test.$suffix=====" >&2
|
||||||
|
cat -- "$failed_test.$suffix" >&2
|
||||||
|
echo >&2
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
done <rpmbuild.tests.sum.not-passing
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Unconditonally dump differences in the system call list.
|
# Unconditonally dump differences in the system call list.
|
||||||
echo "* System call consistency checks:"
|
echo "* System call consistency checks:" >&2
|
||||||
cat misc/tst-syscall-list.out
|
cat misc/tst-syscall-list.out >&2
|
||||||
|
set -x
|
||||||
}
|
}
|
||||||
|
|
||||||
# Increase timeouts
|
# Increase timeouts
|
||||||
@ -1844,12 +1833,6 @@ run_tests
|
|||||||
popd
|
popd
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
echo ====================TESTING DETAILS=================
|
|
||||||
for i in `sed -n 's|^.*\*\*\* \[\([^]]*\.out\)\].*$|\1|p' build-*-linux*/check.log`; do
|
|
||||||
echo =====$i=====
|
|
||||||
cat $i || :
|
|
||||||
echo ============
|
|
||||||
done
|
|
||||||
echo ====================TESTING END=====================
|
echo ====================TESTING END=====================
|
||||||
PLTCMD='/^Relocation section .*\(\.rela\?\.plt\|\.rela\.IA_64\.pltoff\)/,/^$/p'
|
PLTCMD='/^Relocation section .*\(\.rela\?\.plt\|\.rela\.IA_64\.pltoff\)/,/^$/p'
|
||||||
echo ====================PLT RELOCS LD.SO================
|
echo ====================PLT RELOCS LD.SO================
|
||||||
|
Loading…
Reference in New Issue
Block a user