Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
Loading...
Searching...
No Matches
test_type.h File Reference
#include "utilities/core/formatter.h"
#include "utilities/conversion/convert_string.h"
#include <string>
#include <array>
#include <cstdint>
#include <string_view>
Include dependency graph for test_type.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  std::formatter< test_priority >
 Specialization of std::formatter for test_priority. Enables formatting of test_priority enum values as strings using C++20 std::format. More...
 
struct  std::formatter< test_priority, wchar_t >
 Specialization of std::formatter for wide-character test_priority. Allows test_priority enum values to be formatted as wide strings using C++20 std::format. More...
 

Namespaces

namespace  test_detail
 

Enumerations

enum class  test_priority : uint8_t { Top = 0 , Middle , Bottom }
 Enumeration of test priority levels. More...
 

Functions

constexpr std::string_view to_string (test_priority priority)
 Converts a test_priority value to its string representation.
 
auto all_types (void) -> std::vector< test_priority >
 Converts a string to a job_types value.
 

Variables

constexpr std::array test_detail::test_priority_strings = { "Top", "Middle", "Bottom" }
 Array of string representations for each test priority level.
 
constexpr size_t test_detail::test_priority_count = test_priority_strings.size()
 Total number of test types available in test_priority_strings.
 

Enumeration Type Documentation

◆ test_priority

enum class test_priority : uint8_t
strong

Enumeration of test priority levels.

Defines priority levels for test cases. This enum class is based on uint8_t to optimize storage, with three priority levels: Top, Middle, and Bottom.

Enumerator
Top 

Top priority.

Middle 

Middle priority.

Bottom 

Bottom priority.

Definition at line 22 of file test_type.h.

23{
24 Top = 0,
25 Middle,
26 Bottom
27};
@ Bottom
Bottom priority.
@ Top
Top priority.
@ Middle
Middle priority.

Function Documentation

◆ all_types()

auto all_types ( void ) -> std::vector<test_priority>
inlinenodiscard

Converts a string to a job_types value.

Returns
std::vector<test_priority>

Definition at line 62 of file test_type.h.

References Bottom, Middle, and Top.

◆ to_string()

std::string_view to_string ( test_priority priority)
nodiscardconstexpr

Converts a test_priority value to its string representation.

Parameters
priorityThe test_priority value to convert.
Returns
std::string_view String representation of the test priority.

Definition at line 51 of file test_type.h.

52{
53 auto index = static_cast<size_t>(priority);
55 : "Unknown";
56}
@ priority
Priority-based scheduling.
constexpr std::array test_priority_strings
Array of string representations for each test priority level.
Definition test_type.h:34
constexpr size_t test_priority_count
Total number of test types available in test_priority_strings.
Definition test_type.h:39

References test_detail::test_priority_count, and test_detail::test_priority_strings.

Referenced by std::formatter< test_priority >::format(), and std::formatter< test_priority, wchar_t >::format().

Here is the caller graph for this function: