Skip to content

Commit

Permalink
karm-test: Imrpoved driver output.
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Dec 25, 2023
1 parent 1b32c8a commit 24cf407
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/libs/karm-test/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,15 @@ void Driver::runAll() {
Sys::errln("Running {} tests...\n", _tests.len());

for (auto *test : _tests) {
Sys::err(" Running {}: {}...",
Sys::err("Running {}: {}... ",
test->_loc.file, Fmt::toNoCase(test->_name).unwrap());

auto result = test->run(*this);
auto label = result
? Cli::styled(" PASS ", Cli::style(Cli::WHITE).bold().bg(Cli::GREEN_LIGHT))
: Cli::styled(" FAIL ", RED);

Sys::err("{}{}\n", Cli::Cmd::horizontal(0), label);

if (not result) {
Sys::errln(" - {}", Cli::styled(result.none().msg(), RED));
failed++;
} else {
Sys::errln("{}", Cli::styled("PASS", Cli::style(Cli::GREEN).bold()));
passed++;
}
}
Expand Down

0 comments on commit 24cf407

Please sign in to comment.