/
thomas-king
/
ArgumentsParser
Обзор
Документация
Войти
/
thomas-king
/
ArgumentsParser
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
lib/UnitTests/Models/TestSuit.cpp
56 строк
1 KB
Ace Rodstin
Fix tests
20 ноя 2023, 21:08
20 ноя 2023, 21:08
9e5189b
Код
Авторство
О чём код?
// // TestSuit.cpp // UnitTests // // Created by Ace Rodstin on 11/1/23. // Updated by Ace Rodstin on 11/20/23. // // Copyright (C) 2023 Ace Rodstin. All rights reserved. // #include "UnitTests/Models/TestSuit.h" using namespace unit_tests; TestSuit::TestSuit(Id id, vector<TestCase> tests): id { id }, tests { tests } {} void TestSuit::run() { cout << "------- " << "Running " << id << " -------" << endl; int successes = 0; int failures = 0; int total = 0; for (auto test : tests) { setup(); test.run(); string resultMark; if (TestCase::isSuccess) { successes++; resultMark = "[V]"; } else { failures++; resultMark = "[X]"; } total++; cout << id << "." << test.getId() << " " << resultMark << endl; tearDown(); } cout << "Success: " << successes << "/" << total << " tests." << endl; cout << "Failures: " << failures << "/" << total << " tests." << endl; } void TestSuit::setup() { TestCase::isSuccess = true; } void TestSuit::tearDown() { TestCase::isSuccess = false; }