test(thermal): capture blocking NT11 reference comparison
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
#ifndef FESA_TESTS_REFERENCE_THERMAL_REFERENCE_COMPARISON_H_
|
||||
#define FESA_TESTS_REFERENCE_THERMAL_REFERENCE_COMPARISON_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "fesa/core/status.h"
|
||||
#include "reference_tolerance_policy.h"
|
||||
|
||||
namespace fesa::test {
|
||||
struct ThermalReferenceRow {
|
||||
std::string instance;
|
||||
std::uint64_t label;
|
||||
double value;
|
||||
};
|
||||
struct ThermalReferenceSnapshot {
|
||||
std::string step;
|
||||
double time = 0;
|
||||
std::uint64_t increment = 0;
|
||||
int source_dof = 0;
|
||||
std::vector<ThermalReferenceRow> rows;
|
||||
std::string source_input_identity;
|
||||
};
|
||||
struct ThermalReferenceRowDecision {
|
||||
std::string instance;
|
||||
std::uint64_t label;
|
||||
int source_dof;
|
||||
double actual;
|
||||
double reference;
|
||||
ReferenceToleranceRowDecision tolerance;
|
||||
};
|
||||
struct ThermalReferenceReport {
|
||||
bool passed = false;
|
||||
std::vector<ThermalReferenceRowDecision> rows;
|
||||
ReferenceToleranceFamilyDecision family;
|
||||
};
|
||||
|
||||
/// Identity checks precede the unchanged common tolerance policy. Expected
|
||||
/// labels come from the actual input Domain, never CSV row order.
|
||||
Result<ThermalReferenceReport> CompareThermalSnapshots(
|
||||
const ThermalReferenceSnapshot& actual,
|
||||
const ThermalReferenceSnapshot& reference,
|
||||
const std::vector<std::uint64_t>& expected_labels,
|
||||
const std::string& instance);
|
||||
Result<ThermalReferenceSnapshot> ReadThermalReferenceCsv(
|
||||
const std::filesystem::path& path, const std::string& sole_instance);
|
||||
Result<ThermalReferenceSnapshot> ReadThermalReferenceHdf5(
|
||||
const std::filesystem::path& path);
|
||||
Result<ThermalReferenceReport> CompareThermalReferenceFiles(
|
||||
const std::filesystem::path& input, const std::filesystem::path& csv,
|
||||
const std::filesystem::path& hdf5);
|
||||
} // namespace fesa::test
|
||||
#endif
|
||||
Reference in New Issue
Block a user