Compare commits

...
Author SHA1 Message Date
Michal Nowak e6ded8ed5b Omit spurious string from unit test debugging efforts
When both 'broken' and 'failed' test cases appear in unit test output

...
===> Broken tests
lib/isc/tests/socket_test:main  ->  broken: Test case timed out  [300.022s]
===> Failed tests
lib/isc/tests/time_test:main  ->  failed: 2 of 6 tests failed  [0.006s]
===> Summary
...

spurious '===>' string gets matched, that results in the following
error:

  Usage error for command debug: '===>' is not a test case identifier (missing ':'?).

Following change makes sure the string is omitted.

I checked on FreeBSD and OpenBSD that the AWK construct is supported.
2020-01-08 15:20:26 +01:00
+2 -2
View File
@@ -9,7 +9,7 @@ export CMOCKA_MESSAGE_OUTPUT
GDB="$(command -v gdb)"
kyua_report() {
${KYUA} --logfile /dev/null report --results-file "${KYUA_RESULT:-LATEST}"
${KYUA} --logfile /dev/null report --verbose --results-file "${KYUA_RESULT:-LATEST}"
}
status=0
@@ -36,7 +36,7 @@ then
# Use kyua-debug(1) facility to gather additional data on failed tests.
# Some runs will just show verbose information from the run, some will
# show backtrace via gdb(1).
broken_tests="$(kyua_report | awk '/Broken tests/ { flag=1; next } /Summary/ { flag=0 } flag' | awk '{ print $1 }')"
broken_tests=$(kyua_report | awk '$2 == "->" && $0 !~ "skipped" { print $1 }')
if [ -n "${CI}" ] && [ "$(id -u)" -eq 0 ] && [ -n "${broken_tests}" ] && [ -n "${GDB}" ]; then
if grep '^#define USE_LIBTOOL 1$' "${TOP}/config.h" >/dev/null; then
# kyua debug command misidentifies broken binary when libtool is used