[PATCH] app/test: don't count skipped tests as executed
Power, Ciara
ciara.power at intel.com
Tue Mar 5 16:34:12 CET 2024
Hi Bruce,
> -----Original Message-----
> From: Bruce Richardson <bruce.richardson at intel.com>
> Sent: Monday, November 13, 2023 3:06 PM
> To: dev at dpdk.org
> Cc: Richardson, Bruce <bruce.richardson at intel.com>
> Subject: [PATCH] app/test: don't count skipped tests as executed
>
> The logic around skipped tests is a little confusing in the unit test runner.
> * Any explicitly disabled tests are counted as skipped but not
> executed.
> * Any tests that return TEST_SKIPPED are counted as both skipped and
> executed, using the same statistics counters.
>
> This makes the stats very strange and hard to correlate, since the totals don't add
> up. One would expect that SKIPPED + EXECUTED + UNSUPPORTED == TOTAL,
> and that PASSED + FAILED == EXECUTED.
>
> To achieve this, mark any tests returning TEST_SKIPPED, or ENOTSUP as not
> having executed.
>
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> ---
> app/test/test.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/app/test/test.c b/app/test/test.c index bfa9ea52e3..7b882a59de
> 100644
> --- a/app/test/test.c
> +++ b/app/test/test.c
> @@ -375,11 +375,13 @@ unit_test_suite_runner(struct unit_test_suite *suite)
>
> if (test_success == TEST_SUCCESS)
> suite->succeeded++;
> - else if (test_success == TEST_SKIPPED)
> + else if (test_success == TEST_SKIPPED) {
> suite->skipped++;
> - else if (test_success == -ENOTSUP)
> + suite->executed--;
> + } else if (test_success == -ENOTSUP) {
> suite->unsupported++;
> - else
> + suite->executed--;
> + } else
> suite->failed++;
> } else if (test_success == -ENOTSUP) {
> suite->unsupported++;
> --
> 2.39.2
Makes sense - probably something I should have spotted way back when reworking some of the test framework for sub-testsuites.
Thanks
Acked-by: Ciara Power <ciara.power at intel.com>
More information about the dev
mailing list