Verified Commit 9e6f6156 authored by Michal Nowak's avatar Michal Nowak

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.
parent 8648b7cd
Pipeline #31468 failed with stages
in 21 minutes and 1 second
......@@ -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 == "->" && ( $3 == "broken:" || $3 == "failed:" ) { 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment