Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Test.hpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
10#pragma once
11
18#include "TestResult.hpp"
19
20namespace shamtest::details {
21
23 extern TestResult current_test;
24
26 struct Test {
28 std::string name;
30 void (*test_functor)();
31
33 inline Test(const TestType &type, std::string name, const i32 &node_count, void (*func)())
34 : type(type), name(std::move(name)), node_count(node_count), test_functor(func) {}
35
38 };
39
40} // namespace shamtest::details
header describing return type of a test, and the type of the test
TestType
Describe the type of the performed test.
std::int32_t i32
32 bit integer
implementation details of the test library
Definition DataNode.hpp:23
TestResult current_test
Current test being run.
Definition Test.cpp:22
STL namespace.
Informations about a test.
Definition Test.hpp:26
i32 node_count
Node count of the test.
Definition Test.hpp:29
TestResult run()
Run the test.
Definition Test.cpp:24
void(* test_functor)()
Test function.
Definition Test.hpp:30
Test(const TestType &type, std::string name, const i32 &node_count, void(*func)())
CTOR of the test.
Definition Test.hpp:33
std::string name
Name of the test.
Definition Test.hpp:28
TestType type
Type of test.
Definition Test.hpp:27