ores.cpp.component.test_suite
Table of Contents
This page is the node for the ores.cpp.component.test_suite archetype in the codegen
physical-space address graph. Its title is its MASD address; it generates one
output artefact and owns the mustache source below, tangled to the sibling
.mustache consumed by generator.py. Edit this document, then run the
tangle (compass build --direct tangle_codegen_templates).
1. Summary
Generates tests/test_suite.hpp for every component's test target. It
defines test_suite, the logger name every test file in the target uses, once
for the target. It consumes the component model and takes the name from the
component's full name, the same name the test main gives the test module.
The constant used to be defined in each test file's anonymous namespace. A unity build merges several test files into one translation unit, so those copies collided. One definition in a shared header cannot collide, and it keeps every file of a target on the same logger name.
2. The ores.cpp.component.test_suite archetype
{{! GENERATED FILE — tangled from projects/ores.codegen/library/templates/ores.cpp.component.test_suite.org. Edit the org source. }}
{{{cpp_license}}}
{{#component}}
#ifndef {{full_name_upper}}_TESTS_TEST_SUITE_HPP
#define {{full_name_upper}}_TESTS_TEST_SUITE_HPP
#include <string_view>
/**
* @brief The logger name of every test file in this target.
*/
inline constexpr std::string_view test_suite("{{full_name}}.tests");
#endif
{{/component}}
3. See also
- Parent facet: ores.cpp.component
- ores.cpp.component.test_main, which names the test module the same way.
- Template variable reference