refactor: move test name into test class
This commit is contained in:
parent
543b4b832a
commit
3c193fc47b
7 changed files with 17 additions and 14 deletions
23
src/main.cpp
23
src/main.cpp
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue