From e1c7ff58e865d31f2c7c60faf94eb2aaa27d0416 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Sun, 22 Dec 2024 10:05:25 -0500 Subject: junitxml: expose number of tests that passed --- src/lib/core/include/junitxml.h | 2 ++ src/lib/core/junitxml.c | 1 + 2 files changed, 3 insertions(+) (limited to 'src') diff --git a/src/lib/core/include/junitxml.h b/src/lib/core/include/junitxml.h index 777ee27..a6fca19 100644 --- a/src/lib/core/include/junitxml.h +++ b/src/lib/core/include/junitxml.h @@ -68,6 +68,8 @@ struct JUNIT_Testsuite { int failures; /// Total number of skipped tests int skipped; + /// Total number of successful tests + int passed; /// Total number of tests int tests; /// Total duration in fractional seconds diff --git a/src/lib/core/junitxml.c b/src/lib/core/junitxml.c index 8ab231b..f747224 100644 --- a/src/lib/core/junitxml.c +++ b/src/lib/core/junitxml.c @@ -192,6 +192,7 @@ static int read_xml_data(xmlTextReaderPtr reader, struct JUNIT_Testsuite **tests (*testsuite)->testcase[cur_tc]->result_state.skipped = skipped; } } + (*testsuite)->passed = (*testsuite)->tests - (*testsuite)->failures - (*testsuite)->errors - (*testsuite)->skipped; guard_strlist_free(&attrs); return 0; } -- cgit