summaryrefslogtreecommitdiff
path: root/src/unittest.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2022-05-30 19:30:29 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2022-06-09 22:24:44 +0200
commitd9cb571fe126e7e94a52361d733161aa25f23597 (patch)
treed8d43f18a98ea648bd25cd46921d64d0a96c2802 /src/unittest.cc
parentdafd592cf44c184f9d24e2216bbed5c23e4b23c2 (diff)
Add UnitTestLib target type, for unit-test only libraries. And fix unit-test linkage.
Diffstat (limited to 'src/unittest.cc')
-rw-r--r--src/unittest.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/unittest.cc b/src/unittest.cc
index ab82ab9..02f4229 100644
--- a/src/unittest.cc
+++ b/src/unittest.cc
@@ -19,16 +19,21 @@ int runUnitTests(std::set<std::shared_ptr<Task>>& tasks,
{
if(task->targetType() == TargetType::UnitTest)
{
- std::cout << task->name() << ": ";
- auto ret = execute(task->targetFile(), {}, false);
+ auto name = task->name();
+ if(name.empty())
+ {
+ name = task->target();
+ }
+ std::cout << name << ": " << std::flush;
+ auto ret = execute(task->targetFile(), {}, settings.verbose > 0);
ok &= ret == 0;
if(ret == 0)
{
- std::cout << "OK\n";
+ std::cout << " OK\n";
}
else
{
- std::cout << "FAILED\n";
+ std::cout << " FAILED\n";
}
}
}