From 2b1016e1f507fe248c4b02cb3abeb9f478a8dacc Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Mon, 20 Jun 2022 21:29:32 +0200 Subject: report: fix xunit tests count The xunit "section report" provides a tests attribute, which according to https://llg.cubic.org/docs/junit/ represents: tests="" The current value is generated as a sum of the $n_try and $n_notrun counters. This is incorrect as the $n_try counter already includes tests which are run but complete with _notrun. One special case exists for $showme (check -n), where $n_try remains zero, so $n_notrun can be used as-is. Signed-off-by: David Disseldorp Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- check | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'check') diff --git a/check b/check index 43c072d2..a5183d3a 100755 --- a/check +++ b/check @@ -430,13 +430,12 @@ _wrapup() seq="check" check="$RESULT_BASE/check" - if $showme; then - if $needwrap; then - if $do_report; then - _make_section_report - fi - needwrap=false + if $showme && $needwrap; then + if $do_report; then + # $showme = all selected tests are notrun (no tries) + _make_section_report "$n_notrun" "0" "$n_notrun" fi + needwrap=false elif $needwrap; then if [ -f $check.time -a -f $tmp.time ]; then cat $check.time $tmp.time \ @@ -495,7 +494,7 @@ _wrapup() fi echo "" >>$tmp.summary if $do_report; then - _make_section_report + _make_section_report "$n_try" "$n_bad" "$n_notrun" fi needwrap=false fi -- cgit v1.2.3