mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 02:22:43 +00:00 
			
		
		
		
	 5e1499d104
			
		
	
	
		5e1499d104
		
	
	
	
	
		
			
			This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).
This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
		
	
			
		
			
				
	
	
		
			53 lines
		
	
	
	
		
			1.2 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			53 lines
		
	
	
	
		
			1.2 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
 | |
|  * Copyright (c) 2020-2021, Linus Groh <linusg@serenityos.org>
 | |
|  * Copyright (c) 2021, Brian Gianforcaro <bgianf@serenityos.org>
 | |
|  * Copyright (c) 2023, Shannon Booth <shannon@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/ByteString.h>
 | |
| #include <AK/Vector.h>
 | |
| 
 | |
| namespace Test {
 | |
| 
 | |
| enum class Result {
 | |
|     Pass,
 | |
|     Fail,
 | |
|     Skip,
 | |
|     ExpectedFail,
 | |
|     Crashed,
 | |
| };
 | |
| 
 | |
| struct Case {
 | |
|     ByteString name;
 | |
|     Result result;
 | |
|     ByteString details;
 | |
|     u64 duration_us;
 | |
| };
 | |
| 
 | |
| struct Suite {
 | |
|     ByteString path;
 | |
|     ByteString name;
 | |
|     // 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 {};
 | |
| };
 | |
| 
 | |
| 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 tests_expected_failed { 0 };
 | |
|     unsigned suites_failed { 0 };
 | |
|     unsigned suites_passed { 0 };
 | |
|     unsigned files_total { 0 };
 | |
| };
 | |
| 
 | |
| }
 |