summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ctor.cc29
-rw-r--r--test/tasks_test.cc20
2 files changed, 37 insertions, 12 deletions
diff --git a/test/ctor.cc b/test/ctor.cc
index 6515c72..66f20f2 100644
--- a/test/ctor.cc
+++ b/test/ctor.cc
@@ -33,7 +33,7 @@ BuildConfigurations ctorTestConfigs()
"tasks_test.cc",
"testmain.cc",
},
- .depends = {"libctor.a"},
+ .depends = { "libctor_nomain.a" },
.flags = {
.cxxflags = {
"-std=c++20", "-O3", "-s", "-Wall", "-Werror",
@@ -50,7 +50,7 @@ BuildConfigurations ctorTestConfigs()
"source_type_test.cc",
"testmain.cc",
},
- .depends = {"libctor.a"},
+ .depends = { "libctor_nomain.a" },
.flags = {
.cxxflags = {
"-std=c++20", "-O3", "-s", "-Wall", "-Werror",
@@ -60,6 +60,31 @@ BuildConfigurations ctorTestConfigs()
.ldflags = { "-pthread" },
},
},
+ {
+ .type = TargetType::UnitTestLib,
+ .target = "libctor_nomain.a",
+ .sources = {
+ "../src/build.cc",
+ "../src/configure.cc",
+ "../src/execute.cc",
+ "../src/rebuild.cc",
+ "../src/tasks.cc",
+ "../src/task.cc",
+ "../src/task_ar.cc",
+ "../src/task_cc.cc",
+ "../src/task_ld.cc",
+ "../src/task_so.cc",
+ "../src/util.cc",
+ "../src/externals_manual.cc",
+ },
+ .flags = {
+ .cxxflags = {
+ "-std=c++20", "-O3", "-s", "-Wall", "-Werror",
+ "-I../src",
+ },
+ .ldflags = { "-pthread" },
+ },
+ },
};
}
}
diff --git a/test/tasks_test.cc b/test/tasks_test.cc
index 82296b7..a807d32 100644
--- a/test/tasks_test.cc
+++ b/test/tasks_test.cc
@@ -116,20 +116,20 @@ public:
uASSERT_EQUAL(6u, tasks.size());
// Note: count() is used here because the order of
// std::set<std::shared_ptr<T>> is not deterministic.
- uASSERT_EQUAL(1u, count(tasks, "foo/test/target1"s));
- uASSERT_EQUAL(1u, count(tasks, "foo/test/target2"s));
- uASSERT_EQUAL(1u, count(tasks, "foo/test/target3"s));
- uASSERT_EQUAL(1u, count(tasks, "foo/test/target4"s));
- uASSERT_EQUAL(1u, count(tasks, "foo/test/target1-foo_cc.o"s));
- uASSERT_EQUAL(1u, count(tasks, "foo/test/target1-bar_c.o"s));
+ uASSERT_EQUAL(1u, count(tasks, "target1"s));
+ uASSERT_EQUAL(1u, count(tasks, "target2"s));
+ uASSERT_EQUAL(1u, count(tasks, "target3"s));
+ uASSERT_EQUAL(1u, count(tasks, "target4"s));
+ uASSERT_EQUAL(1u, count(tasks, "test/target1-foo_cc.o"s));
+ uASSERT_EQUAL(1u, count(tasks, "test/target1-bar_c.o"s));
}
{
auto tasks = getTasks(settings, {"target1", "target3"});
uASSERT_EQUAL(4u, tasks.size());
- uASSERT_EQUAL(1u, count(tasks, "foo/test/target1"s));
- uASSERT_EQUAL(1u, count(tasks, "foo/test/target3"s));
- uASSERT_EQUAL(1u, count(tasks, "foo/test/target1-foo_cc.o"s));
- uASSERT_EQUAL(1u, count(tasks, "foo/test/target1-bar_c.o"s));
+ uASSERT_EQUAL(1u, count(tasks, "target1"s));
+ uASSERT_EQUAL(1u, count(tasks, "target3"s));
+ uASSERT_EQUAL(1u, count(tasks, "test/target1-foo_cc.o"s));
+ uASSERT_EQUAL(1u, count(tasks, "test/target1-bar_c.o"s));
}
{
auto tasks = getTasks(settings, {"no-such-target"});