Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
TestDataList.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 "TestData.hpp"
19#include <vector>
20
21namespace shamtest::details {
22
24 struct TestDataList {
25
27 std::vector<TestData> test_data;
28
29 // define member function here
30 // to register test data
31
33 [[nodiscard]] inline TestData &new_dataset(std::string name) {
34 test_data.push_back(TestData{std::move(name), {}});
35 return test_data.back();
36 }
37
39 std::string serialize_json();
41 void serialize(std::basic_stringstream<byte> &stream);
43 static TestDataList deserialize(std::basic_stringstream<byte> &reader);
44 };
45
46} // namespace shamtest::details
implementation details of the test library
Definition DataNode.hpp:23
List of data generated by a test.
std::string serialize_json()
Serialize the assertion in JSON.
std::vector< TestData > test_data
Held test data.
void serialize(std::basic_stringstream< byte > &stream)
Serialize the assertion in binary format.
TestData & new_dataset(std::string name)
Create a new TestData in this TestDataList and return a reference to it.
static TestDataList deserialize(std::basic_stringstream< byte > &reader)
DeSerialize the assertion from binary format.