From bce1f956e758dcd8141b0522a204d3ab71ece13f Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Tue, 23 Mar 2021 23:19:31 +0100 Subject: [PATCH] LibTest: Add Test::Counts This is the JSTestRunnerCounts struct from test-js and test-web (but using unsigned integers - no negative counts). Not all test runners will use all fields, but all will want to keep track of various counts. --- Userland/Libraries/LibTest/Results.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibTest/Results.h b/Userland/Libraries/LibTest/Results.h index 6fb36c9602..b6e7a1b0ba 100644 --- a/Userland/Libraries/LibTest/Results.h +++ b/Userland/Libraries/LibTest/Results.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, Matthew Olsson - * Copyright (c) 2020, Linus Groh + * Copyright (c) 2020-2021, Linus Groh * Copyright (c) 2021, Brian Gianforcaro * All rights reserved. * @@ -53,4 +53,15 @@ struct Suite { Vector tests {}; }; +struct Counts { + // Not all of these might be used by a certain test runner, e.g. some + // do not have a concept of suites, or might not load tests from files. + unsigned tests_failed { 0 }; + unsigned tests_passed { 0 }; + unsigned tests_skipped { 0 }; + unsigned suites_failed { 0 }; + unsigned suites_passed { 0 }; + unsigned files_total { 0 }; +}; + }