diff options
author | David Disseldorp <ddiss@suse.de> | 2022-06-20 21:29:32 +0200 |
---|---|---|
committer | Zorro Lang <zlang@kernel.org> | 2022-06-24 23:15:03 +0800 |
commit | 2b1016e1f507fe248c4b02cb3abeb9f478a8dacc (patch) | |
tree | fc6c49ba8a263bc08b57ccf1f92aa170a83d07d2 /check | |
parent | 40aa19bcc2f18d71d5a3f5e2662014357f035e85 (diff) |
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 total number of tests in the suite, required. -->
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 <ddiss@suse.de>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
Diffstat (limited to 'check')
-rwxr-xr-x | check | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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 |