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:
Florian Weimer 2018-01-19 12:02:32 +01:00
parent 5163dbee45
commit 5c2fe5cfb3

View File

@ -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 exit 1
make %{?_smp_mflags} -O check > check.log 2>&1 fi
status=$? set +x
echo $status) grep -v ^PASS: tests.sum > rpmbuild.tests.sum.not-passing || true
# Wait for the tail to catch up with the output and then kill it. if test -n rpmbuild.tests.sum.not-passing ; then
sleep 10 echo ===================FAILED TESTS===================== >&2
kill $tailpid echo "Target: $(basename "$(pwd)")" >& 2
# Print the header, so we can find it, but skip the error printing cat rpmbuild.tests.sum.not-passing >&2
# if there aren't any failrues. while read failed_code failed_test ; do
echo ===================FAILED TESTS===================== for suffix in out test-result ; do
if [ $status -ne 0 ]; then if test -e "$failed_test.$suffix"; then
# We are not running with `-k`, therefore a test build failure echo >&2
# terminates the test run and that terminates %check with an echo "=====$failed_code $failed_test.$suffix=====" >&2
# error which terminates the build. We want this behaviour to cat -- "$failed_test.$suffix" >&2
# ensure that all tests build, and all tests run. echo >&2
# If the test result summary is not present it means one of fi
# tests failed to build. done
if ! grep 'Summary of test results:' check.log; then done <rpmbuild.tests.sum.not-passing
echo "FAIL: Some glibc tests failed to build." fi
exit 1
fi
# Print out information about all of the failed tests. # Unconditonally dump differences in the system call list.
grep -e ^FAIL -e ^ERROR tests.sum \ echo "* System call consistency checks:" >&2
| awk '{print $2}' \ cat misc/tst-syscall-list.out >&2
| while read testcase; set -x
do
echo "$testcase"
cat $testcase.out
echo -------------------------
done
fi
# Unconditonally dump differences in the system call list.
echo "* System call consistency checks:"
cat misc/tst-syscall-list.out
} }
# Increase timeouts # Increase timeouts
@ -1798,7 +1787,7 @@ parent=$$
echo ====================TESTING========================= echo ====================TESTING=========================
############################################################################## ##############################################################################
# - Test the default runtime. # - Test the default runtime.
# - Power 620 / 970 ISA for 64-bit POWER BE. # - Power 620 / 970 ISA for 64-bit POWER BE.
# - POWER8 for 64-bit POWER LE. # - POWER8 for 64-bit POWER LE.
# - ??? for 64-bit x86_64 # - ??? for 64-bit x86_64
# - ??? for 32-bit x86 # - ??? for 32-bit x86
@ -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================