Skip to content

Commit

Permalink
test: notify when a test times out
Browse files Browse the repository at this point in the history
  • Loading branch information
Mishura4 committed Jul 16, 2023
1 parent 3f6384e commit 999f0a2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/unittest/unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ int test_summary() {
std::cout << "\u001b[37;1m\n\nUNIT TEST SUMMARY\n==================\n\u001b[0m";
for (auto & t : tests) {
bool test_skipped = false;
if (t.second.executed == false && ((t.second.type == tt_online && offline) || (t.second.type == tt_extended && !extended))) {
if ((t.second.type == tt_online && offline) || (t.second.type == tt_extended && !extended)) {
skipped++;
test_skipped = true;
} else {
Expand Down Expand Up @@ -304,7 +304,7 @@ void wait_for_tests() {
executed++;
} else if (!t.second.executed && ((offline && t.second.type == tt_online) || (!extended && t.second.type == tt_extended))) {
executed++;
t.second.success = true;
t.second.executed = true;
std::cout << "[" << std::fixed << std::setprecision(3) << get_time() << "]: " << "[\u001b[33mSKIPPED\u001b[0m] " << t.second.description << "\n";
}
}
Expand All @@ -315,4 +315,8 @@ void wait_for_tests() {
std::this_thread::sleep_for(std::chrono::seconds(1));
ticks++;
}
for (auto &t : tests) {
if (!t.second.executed)
std::cout << "[" << std::fixed << std::setprecision(3) << get_time() << "]: " << "[\u001b[31mTIMEOUT\u001b[0m] " << t.second.description << "\n";
}
}

0 comments on commit 999f0a2

Please sign in to comment.