summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap.cc3
-rw-r--r--src/libctor.cc9
-rw-r--r--src/libctor.h1
-rw-r--r--src/tasks.cc1
-rw-r--r--src/unittest.cc13
5 files changed, 19 insertions, 8 deletions
diff --git a/src/bootstrap.cc b/src/bootstrap.cc
index 08f7b1f..64f11fc 100644
--- a/src/bootstrap.cc
+++ b/src/bootstrap.cc
@@ -66,7 +66,8 @@ int main(int argc, char* argv[])
auto& targets = getTargets(settings);
for(const auto& target : targets)
{
- if(target.config.type != TargetType::UnitTest)
+ if(target.config.type != TargetType::UnitTest &&
+ target.config.type != TargetType::UnitTestLib)
{
non_unittest_targets.push_back(target);
}
diff --git a/src/libctor.cc b/src/libctor.cc
index a2c873e..a4aec86 100644
--- a/src/libctor.cc
+++ b/src/libctor.cc
@@ -316,7 +316,8 @@ Options:
auto& targets = getTargets(settings);
for(const auto& target : targets)
{
- if(target.config.type == TargetType::UnitTest)
+ if(target.config.type == TargetType::UnitTest ||
+ target.config.type == TargetType::UnitTestLib)
{
unittest_targets.push_back(target);
}
@@ -338,7 +339,8 @@ Options:
auto& targets = getTargets(settings);
for(const auto& target : targets)
{
- if(target.config.type != TargetType::UnitTest)
+ if(target.config.type != TargetType::UnitTest &&
+ target.config.type != TargetType::UnitTestLib)
{
non_unittest_targets.push_back(target);
}
@@ -367,7 +369,8 @@ Options:
auto& targets = getTargets(settings);
for(const auto& target : targets)
{
- if(target.config.type != TargetType::UnitTest)
+ if(target.config.type != TargetType::UnitTest &&
+ target.config.type != TargetType::UnitTestLib)
{
non_unittest_targets.push_back(target);
}
diff --git a/src/libctor.h b/src/libctor.h
index 721ac6a..70f2c3e 100644
--- a/src/libctor.h
+++ b/src/libctor.h
@@ -18,6 +18,7 @@ enum class TargetType
DynamicLibrary,
Object,
UnitTest,
+ UnitTestLib,
};
enum class Language
diff --git a/src/tasks.cc b/src/tasks.cc
index f24f3cb..af364b9 100644
--- a/src/tasks.cc
+++ b/src/tasks.cc
@@ -122,6 +122,7 @@ std::set<std::shared_ptr<Task>> taskFactory(const BuildConfiguration& config,
break;
case TargetType::StaticLibrary:
+ case TargetType::UnitTestLib:
tasks.insert(std::make_shared<TaskAR>(config, settings, config.target,
objects, sourceDir));
break;
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";
}
}
}