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