21 lines
539 B
C++
21 lines
539 B
C++
#include "tests/test_framework.hpp"
|
|||
|
|
|
||
|
|
#include <iostream>
|
||
|
|
|
||
|
|
int main() {
|
||
|
|
int total = 0;
|
||
|
|
int failed = 0;
|
||
|
|
for (const auto& tc : htab::test::registry()) {
|
||
|
|
++total;
|
||
|
|
htab::test::failures_in_current_test() = 0;
|
||
|
|
tc.fn();
|
||
|
|
if (htab::test::failures_in_current_test() > 0) {
|
||
|
|
++failed;
|
||
|
|
std::cerr << "[FAIL] " << tc.name << "\n";
|
||
|
|
} else {
|
||
|
|
std::cout << "[PASS] " << tc.name << "\n";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
std::cout << "Summary: " << (total - failed) << "/" << total << " tests passed.\n";
|
||
|
|
return failed == 0 ? 0 : 1;
|
||
|
|
}
|