refactor: move test name into test class

This commit is contained in:
Michael Mandl 2023-10-21 21:29:36 +02:00
parent 543b4b832a
commit 3c193fc47b
Signed by: mandlm
GPG key ID: 4AA25D647AA54CC7
7 changed files with 17 additions and 14 deletions

View file

@ -12,24 +12,19 @@
int main(int argc, char **argv) {
std::cout << "Running " << PROJECT_NAME << ", version " << VERSION << "\n"
std::cout << "Running " << PROJECT_NAME << ", version " << VERSION
<< std::endl;
std::vector<std::tuple<const char *, std::unique_ptr<ChapterTest>>>
chapter_2_tests;
std::vector<std::unique_ptr<ChapterTest>> chapter_2_tests;
chapter_2_tests.emplace_back("Nullptr test", std::make_unique<NullTest>());
chapter_2_tests.emplace_back("If/Switch test",
std::make_unique<IfswitchTest>());
chapter_2_tests.emplace_back("Constexpr test",
std::make_unique<ConstExpTest>());
chapter_2_tests.emplace_back("Initializer list test",
std::make_unique<InitListTest>());
chapter_2_tests.emplace_back("Structured binding test",
std::make_unique<StructuredBindingTest>());
chapter_2_tests.emplace_back(std::make_unique<NullTest>());
chapter_2_tests.emplace_back(std::make_unique<IfswitchTest>());
chapter_2_tests.emplace_back(std::make_unique<ConstExpTest>());
chapter_2_tests.emplace_back(std::make_unique<InitListTest>());
chapter_2_tests.emplace_back(std::make_unique<StructuredBindingTest>());
for (auto &[test_description, test] : chapter_2_tests) {
std::cout << "\n" << test_description << ":" << std::endl;
for (auto &test : chapter_2_tests) {
std::cout << "\n" << test->name() << ":" << std::endl;
test->run();
}