28namespace sequoia::testing
36 std::chrono::nanoseconds time_elapsed()
const;
38 using time_point = std::chrono::steady_clock::time_point;
51 explicit test_base(std::string name) : m_Name{std::move(name)} {}
54 : m_Name{std::move(name)}
55 , m_ProjectPaths{std::move(projPaths)}
56 , m_Materials{std::move(materials)}
57 , m_Diagnostics{get_project_paths().project_root(), suiteName, srcFile, mode, outputDiscriminator}
58 , m_SummaryFile{srcFile, m_ProjectPaths, summaryDiscriminator}
60 std::filesystem::create_directories(m_Diagnostics.false_positive_or_negative_file_path().parent_path());
67 const std::string& name()
const noexcept
73 std::filesystem::path working_materials()
const
75 return m_Materials.working();
79 std::filesystem::path predictive_materials()
const
81 return m_Materials.prediction();
85 std::filesystem::path auxiliary_materials()
const
87 return m_Materials.auxiliary();
93 return m_ProjectPaths;
105 return m_SummaryFile;
109 std::string report(
const reporter& rep)
const
111 return rep.location() ? testing::report_line(rep.message(), m_ProjectPaths.tests().repo(), rep.location().value()) : rep.message();
119 void write_instability_analysis_output(
const normal_path& srcFile, std::optional<std::size_t> index,
const failure_output& output)
const;
121 std::string m_Name{};
142 template<test_mode Mode,
class Extender>
147 constexpr static test_mode mode{Mode};
152 :
test_base{std::move(name), Mode, suiteName, srcFile, projPaths, std::move(materials), outputDiscriminator, summaryDiscriminator}
159 using checker_type::reset_results;
161 using duration = std::chrono::steady_clock::duration;
171 return checker_type::summary(name(), delta);
176 void log_critical_failure(
const normal_path& srcFile, std::string_view tag, std::string_view what)
178 auto sentry{checker_type::make_sentinel(
"")};
179 sentry.log_critical_failure(exception_message(tag, srcFile, checker_type::exceptions_detected_by_sentinel(), what));
182 void write_instability_analysis_output(
const normal_path& srcFile, std::optional<std::size_t> index)
const
184 test_base::write_instability_analysis_output(srcFile, index, checker_type::failure_messages());
191 { test.run_tests() };
192 { test.source_file() } -> std::convertible_to<std::filesystem::path>;
193 { test.reset_results() };
195 && std::derived_from<T, test_base> && std::movable<T> && std::destructible<T>;
197 template<concrete_test T>
198 inline constexpr bool has_discriminated_output_v{
199 requires(
const T& t){
200 { t.output_discriminator() } -> std::convertible_to<std::string>;
204 template<concrete_test T>
205 inline constexpr bool has_discriminated_summary_v{
206 requires(
const T & t){
207 { t.summary_discriminator() } -> std::convertible_to<std::string>;
223 template<test_mode Mode>
232 inline constexpr bool has_parallelizable_type{
234 typename T::parallelizable_type;
235 requires std::is_convertible_v<typename T::parallelizable_type, std::true_type> || std::is_convertible_v<typename T::parallelizable_type, std::false_type>;
249 template<concrete_test T>
252 template<concrete_test T>
253 requires has_parallelizable_type<T>
Concepts which are sufficiently general to appear in the sequoia namespace.
Useful specializations for the class template value_tester.
Extensions to the std::filesystem library.
File paths pertaining to individual tests.
A collection of functions for making substitutions within text.
Definition: FileSystem.hpp:20
class template from which all concrete tests should derive.
Definition: FreeTestCore.hpp:144
Exposes elementary check methods, with the option to plug in arbitrary Extenders to compose functiona...
Definition: FreeCheckers.hpp:708
Definition: IndividualTestPaths.hpp:64
Definition: IndividualTestPaths.hpp:20
Summaries data generated by the logger, for the purposes of reporting.
Definition: TestLogger.hpp:299
Paths used by the project.
Definition: ProjectPaths.hpp:469
Definition: Output.hpp:186
class from which all tests ultimately derive
Definition: FreeTestCore.hpp:49
Definition: IndividualTestPaths.hpp:90
Definition: TestRunner.hpp:59
Definition: FreeTestCore.hpp:31
Temporary workaround while waiting for variadic friends.
Definition: FreeTestCore.hpp:213
Definition: FreeTestCore.hpp:189
Holds paths to files where recovery information will be written if the path is not empty.
Definition: TestLogger.hpp:36
Definition: FreeTestCore.hpp:241