2021-03-01 00:09:13 +03:00
|
|
|
/*
|
2021-04-23 02:53:07 +03:00
|
|
|
* Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
|
2021-04-22 23:51:19 +03:00
|
|
|
* Copyright (c) 2020-2021, Linus Groh <linusg@serenityos.org>
|
2021-04-22 22:11:04 +03:00
|
|
|
* Copyright (c) 2021, Brian Gianforcaro <bgianf@serenityos.org>
|
2023-07-22 10:39:31 +03:00
|
|
|
* Copyright (c) 2023, Shannon Booth <shannon@serenityos.org>
|
2021-03-01 00:09:13 +03:00
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-03-01 00:09:13 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-12-04 21:02:33 +03:00
|
|
|
#include <AK/DeprecatedString.h>
|
2021-03-01 00:09:13 +03:00
|
|
|
#include <AK/Vector.h>
|
|
|
|
|
|
|
|
namespace Test {
|
|
|
|
|
|
|
|
enum class Result {
|
|
|
|
Pass,
|
|
|
|
Fail,
|
|
|
|
Skip,
|
2023-07-22 10:39:31 +03:00
|
|
|
ExpectedFail,
|
2021-06-27 23:22:25 +03:00
|
|
|
Crashed,
|
2021-03-01 00:09:13 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Case {
|
2022-12-04 21:02:33 +03:00
|
|
|
DeprecatedString name;
|
2021-03-01 00:09:13 +03:00
|
|
|
Result result;
|
2022-12-04 21:02:33 +03:00
|
|
|
DeprecatedString details;
|
2022-03-08 06:39:41 +03:00
|
|
|
u64 duration_us;
|
2021-03-01 00:09:13 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Suite {
|
2022-12-04 21:02:33 +03:00
|
|
|
DeprecatedString path;
|
|
|
|
DeprecatedString name;
|
2021-03-01 00:09:13 +03:00
|
|
|
// A failed test takes precedence over a skipped test, which both have
|
|
|
|
// precedence over a passed test
|
|
|
|
Result most_severe_test_result { Result::Pass };
|
|
|
|
Vector<Case> tests {};
|
|
|
|
};
|
|
|
|
|
2021-03-24 01:19:31 +03:00
|
|
|
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 };
|
2023-07-22 10:39:31 +03:00
|
|
|
unsigned tests_expected_failed { 0 };
|
2021-03-24 01:19:31 +03:00
|
|
|
unsigned suites_failed { 0 };
|
|
|
|
unsigned suites_passed { 0 };
|
|
|
|
unsigned files_total { 0 };
|
|
|
|
};
|
|
|
|
|
2021-03-01 00:09:13 +03:00
|
|
|
}
|