summaryrefslogtreecommitdiff
path: root/test/ctor.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2026-02-06 18:25:41 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2026-02-06 18:25:41 +0100
commit668158a83bc9e5af7bf65fe88d22d1958e33443f (patch)
tree245e0649ae3b420a8ad013d2ae6824852e58cbdc /test/ctor.cc
parent19d1dd34fbc87b6637147785332f180e36acdfef (diff)
New syntaxdevelop
Diffstat (limited to 'test/ctor.cc')
-rw-r--r--test/ctor.cc320
1 files changed, 148 insertions, 172 deletions
diff --git a/test/ctor.cc b/test/ctor.cc
index e7ed038..afec91c 100644
--- a/test/ctor.cc
+++ b/test/ctor.cc
@@ -8,244 +8,220 @@ namespace
ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
{
return
- {
{
- .type = ctor::target_type::unit_test,
- .system = ctor::output_system::build,
- .target = "argparser_test",
- .sources = {
- "argparser_test.cc",
- "testmain.cc",
- },
- .flags = {
- .cxxflags = {
+ {
+ ctor::target_type::unit_test,
+ ctor::output_system::build,
+ ctor::target("argparser_test"),
+ ctor::sources{
+ "argparser_test.cc",
+ "testmain.cc",
+ },
+ ctor::cxx_flags{
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"argparser\"",
"-fexceptions",
},
},
- },
- {
- .type = ctor::target_type::unit_test,
- .system = ctor::output_system::build,
- .target = "generated_sources_test",
- .sources = {
- "generated_sources_test.cc",
- "testmain.cc",
- },
- .depends = { "libctor_nomain.a" },
- .flags = {
- .cxxflags = {
+ {
+ ctor::target_type::unit_test,
+ ctor::output_system::build,
+ ctor::target("generated_sources_test"),
+ ctor::sources{
+ "generated_sources_test.cc",
+ "testmain.cc",
+ },
+ ctor::depends({"libctor_nomain.a"}),
+ ctor::cxx_flags{
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"generated_sources\"",
"-fexceptions",
},
},
- },
- {
- .type = ctor::target_type::unit_test,
- .system = ctor::output_system::build,
- .target = "argsplit_test",
- .sources = {
- "argsplit_test.cc",
- "testmain.cc",
- "../src/util.cc",
- },
- .flags = {
- .cxxflags = {
+ {
+ ctor::target_type::unit_test,
+ ctor::output_system::build,
+ ctor::target("argsplit_test"),
+ ctor::sources{
+ "argsplit_test.cc",
+ "testmain.cc",
+ "../src/util.cc",
+ },
+ ctor::cxx_flags{
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"argsplit\"",
"-fexceptions",
},
},
- },
- {
- .type = ctor::target_type::unit_test,
- .system = ctor::output_system::build,
- .target = "pointerlist_test",
- .sources = {
- "pointerlist_test.cc",
- "testmain.cc",
- "../src/pointerlist.cc",
- },
- .flags = {
- .cxxflags = {
+ {
+ ctor::target_type::unit_test,
+ ctor::output_system::build,
+ ctor::target("pointerlist_test"),
+ ctor::sources{
+ "pointerlist_test.cc",
+ "testmain.cc",
+ "../src/pointerlist.cc",
+ },
+ ctor::cxx_flags{
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"pointerlist\"",
"-fexceptions",
},
},
- },
- {
- .type = ctor::target_type::unit_test,
- .system = ctor::output_system::build,
- .target = "deps_test",
- .sources = {
- "deps_test.cc",
- "testmain.cc",
- "../src/deps.cc",
- "../src/util.cc",
- },
- .depends = { "testprog", },
- .flags = {
- .cxxflags = {
+ {
+ ctor::target_type::unit_test,
+ ctor::output_system::build,
+ ctor::target("deps_test"),
+ ctor::sources{
+ "deps_test.cc",
+ "testmain.cc",
+ "../src/deps.cc",
+ "../src/util.cc",
+ },
+ ctor::depends({"testprog"}),
+ ctor::cxx_flags{
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"deps\"",
"-fexceptions",
},
},
- },
- {
- .type = ctor::target_type::unit_test,
- .system = ctor::output_system::build,
- .target = "testprog",
- .sources = {
- "testprog.cc",
- },
- .flags = {
- .cxxflags = {
+ {
+ ctor::target_type::unit_test,
+ ctor::output_system::build,
+ ctor::target("testprog"),
+ ctor::sources{
+ "testprog.cc",
+ },
+ ctor::cxx_flags{
"-std=c++20", "-O3", "-Wall",
"-fexceptions",
},
},
- },
- {
- .type = ctor::target_type::unit_test,
- .system = ctor::output_system::build,
- .target = "execute_test",
- .sources = {
- "execute_test.cc",
- "testmain.cc",
- "../src/execute.cc",
- "../src/pointerlist.cc",
- "../src/util.cc",
- },
- .depends = { "testprog", },
- .flags = {
- .cxxflags = {
+ {
+ ctor::target_type::unit_test,
+ ctor::output_system::build,
+ ctor::target("execute_test"),
+ ctor::sources{
+ "execute_test.cc",
+ "testmain.cc",
+ "../src/execute.cc",
+ "../src/pointerlist.cc",
+ "../src/util.cc",
+ },
+ ctor::depends({"testprog"}),
+ ctor::cxx_flags{
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"execute\"",
"-fexceptions",
},
- .ldflags = { "-pthread" },
- },
- },
- {
- .type = ctor::target_type::unit_test,
- .system = ctor::output_system::build,
- .target = "tasks_test",
- .sources = {
- "tasks_test.cc",
- "testmain.cc",
- },
- .depends = { "libctor_nomain.a" },
- .flags = {
- .cxxflags = {
+ ctor::ld_flags{ "-pthread" },
+ },
+ {
+ ctor::target_type::unit_test,
+ ctor::output_system::build,
+ ctor::target("tasks_test"),
+ ctor::sources{
+ "tasks_test.cc",
+ "testmain.cc",
+ },
+ ctor::depends({"libctor_nomain.a"}),
+ ctor::cxx_flags{
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"tasks\"",
"-fexceptions",
},
- .ldflags = { "-pthread" },
- },
- },
- {
- .type = ctor::target_type::unit_test,
- .system = ctor::output_system::build,
- .target = "cycle_test",
- .sources = {
- "cycle_test.cc",
- "testmain.cc",
- },
- .depends = { "libctor_nomain.a" },
- .flags = {
- .cxxflags = {
+ ctor::ld_flags{ "-pthread" },
+ },
+ {
+ ctor::target_type::unit_test,
+ ctor::output_system::build,
+ ctor::target("cycle_test"),
+ ctor::sources{
+ "cycle_test.cc",
+ "testmain.cc",
+ },
+ ctor::depends({"libctor_nomain.a"}),
+ ctor::cxx_flags{
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"cycle\"",
"-fexceptions",
},
- .ldflags = { "-pthread" },
- },
- },
- {
- .type = ctor::target_type::unit_test,
- .system = ctor::output_system::build,
- .target = "source_type_test",
- .sources = {
- "source_type_test.cc",
- "testmain.cc",
- },
- .depends = { "libctor_nomain.a" },
- .flags = {
- .cxxflags = {
+ ctor::ld_flags{ "-pthread" },
+ },
+ {
+ ctor::target_type::unit_test,
+ ctor::output_system::build,
+ ctor::target("source_type_test"),
+ ctor::sources{
+ "source_type_test.cc",
+ "testmain.cc",
+ },
+ ctor::depends({"libctor_nomain.a"}),
+ ctor::cxx_flags{
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"source_type\"",
"-fexceptions",
},
- .ldflags = { "-pthread" },
- },
- },
- {
- .type = ctor::target_type::unit_test,
- .system = ctor::output_system::build,
- .target = "tools_test",
- .sources = {
- "tools_test.cc",
- "testmain.cc",
- "../src/util.cc",
- "../src/tools.cc",
- },
- //.depends = { "libctor_nomain.a" },
- .flags = {
- .cxxflags = {
+ ctor::ld_flags{ "-pthread" },
+ },
+ {
+ ctor::target_type::unit_test,
+ ctor::output_system::build,
+ ctor::target("tools_test"),
+ ctor::sources{
+ "tools_test.cc",
+ "testmain.cc",
+ "../src/util.cc",
+ "../src/tools.cc",
+ },
+ ctor::depends({"libctor_nomain.a"}),
+ ctor::cxx_flags{
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"tools\"",
"-fexceptions",
},
},
- },
- {
- .type = ctor::target_type::unit_test_library,
- .system = ctor::output_system::build,
- .target = "libctor_nomain.a",
- .sources = {
- "../src/build.cc",
- "../src/configure.cc",
- "../src/deps.cc",
- "../src/execute.cc",
- "../src/pointerlist.cc",
- "../src/rebuild.cc",
- "../src/tasks.cc",
- "../src/task.cc",
- "../src/task_ar.cc",
- "../src/task_cc.cc",
- "../src/task_fn.cc",
- "../src/task_ld.cc",
- "../src/task_so.cc",
- "../src/tools.cc",
- "../src/util.cc",
- "../src/externals_manual.cc",
- "../configuration.cc",
- },
- .flags = {
- .cxxflags = {
+ {
+ ctor::target_type::unit_test_library,
+ ctor::output_system::build,
+ ctor::target("libctor_nomain.a"),
+ ctor::sources{
+ "../src/build.cc",
+ "../src/configure.cc",
+ "../src/deps.cc",
+ "../src/execute.cc",
+ "../src/pointerlist.cc",
+ "../src/rebuild.cc",
+ "../src/tasks.cc",
+ "../src/task.cc",
+ "../src/task_ar.cc",
+ "../src/task_cc.cc",
+ "../src/task_fn.cc",
+ "../src/task_ld.cc",
+ "../src/task_so.cc",
+ "../src/tools.cc",
+ "../src/util.cc",
+ "../src/externals_manual.cc",
+ "../configuration.cc",
+ },
+ ctor::cxx_flags{
"-std=c++20", "-O3", "-Wall",
"-I../src",
"-fexceptions",
},
- .ldflags = { "-pthread" },
+ ctor::ld_flags{ "-pthread" },
},
- },
- };
+ };
}
}