summaryrefslogtreecommitdiff
path: root/test/ctor.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/ctor.cc')
-rw-r--r--test/ctor.cc133
1 files changed, 122 insertions, 11 deletions
diff --git a/test/ctor.cc b/test/ctor.cc
index 9b690a2..0d77a3e 100644
--- a/test/ctor.cc
+++ b/test/ctor.cc
@@ -1,25 +1,111 @@
// -*- c++ -*-
// Distributed under the BSD 2-Clause License.
// See accompanying file LICENSE for details.
-#include <libctor.h>
+#include <ctor.h>
namespace
{
-BuildConfigurations ctorTestConfigs(const Settings& settings)
+ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
{
return
{
{
- .type = TargetType::UnitTest,
+ .type = ctor::target_type::unit_test,
+ .system = ctor::output_system::build,
+ .target = "argparser_test",
+ .sources = {
+ "argparser_test.cc",
+ "testmain.cc",
+ },
+ .flags = {
+ .cxxflags = {
+ "-std=c++20", "-O3", "-Wall", "-Werror",
+ "-I../src", "-Iuunit",
+ "-DOUTPUT=\"argparser\"",
+ },
+ },
+ },
+ {
+ .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 = {
+ "-std=c++20", "-O3", "-Wall", "-Werror",
+ "-I../src", "-Iuunit",
+ "-DOUTPUT=\"argsplit\"",
+ },
+ },
+ },
+ {
+ .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 = {
+ "-std=c++20", "-O3", "-Wall", "-Werror",
+ "-I../src", "-Iuunit",
+ "-DOUTPUT=\"pointerlist\"",
+ },
+ },
+ },
+ {
+ .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 = {
+ "-std=c++20", "-O3", "-Wall", "-Werror",
+ "-I../src", "-Iuunit",
+ "-DOUTPUT=\"deps\"",
+ },
+ },
+ },
+ {
+ .type = ctor::target_type::unit_test,
+ .system = ctor::output_system::build,
+ .target = "testprog",
+ .sources = {
+ "testprog.cc",
+ },
+ .flags = {
+ .cxxflags = {
+ "-std=c++20", "-O3", "-Wall", "-Werror",
+ },
+ },
+ },
+ {
+ .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 = {
- "-std=c++20", "-O3", "-s", "-Wall", "-Werror",
+ "-std=c++20", "-O3", "-Wall", "-Werror",
"-I../src", "-Iuunit",
"-DOUTPUT=\"execute\"",
},
@@ -27,7 +113,8 @@ BuildConfigurations ctorTestConfigs(const Settings& settings)
},
},
{
- .type = TargetType::UnitTest,
+ .type = ctor::target_type::unit_test,
+ .system = ctor::output_system::build,
.target = "tasks_test",
.sources = {
"tasks_test.cc",
@@ -36,7 +123,7 @@ BuildConfigurations ctorTestConfigs(const Settings& settings)
.depends = { "libctor_nomain.a" },
.flags = {
.cxxflags = {
- "-std=c++20", "-O3", "-s", "-Wall", "-Werror",
+ "-std=c++20", "-O3", "-Wall", "-Werror",
"-I../src", "-Iuunit",
"-DOUTPUT=\"tasks\"",
},
@@ -44,7 +131,26 @@ BuildConfigurations ctorTestConfigs(const Settings& settings)
},
},
{
- .type = TargetType::UnitTest,
+ .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 = {
+ "-std=c++20", "-O3", "-Wall", "-Werror",
+ "-I../src", "-Iuunit",
+ "-DOUTPUT=\"cycle\"",
+ },
+ .ldflags = { "-pthread" },
+ },
+ },
+ {
+ .type = ctor::target_type::unit_test,
+ .system = ctor::output_system::build,
.target = "source_type_test",
.sources = {
"source_type_test.cc",
@@ -53,7 +159,7 @@ BuildConfigurations ctorTestConfigs(const Settings& settings)
.depends = { "libctor_nomain.a" },
.flags = {
.cxxflags = {
- "-std=c++20", "-O3", "-s", "-Wall", "-Werror",
+ "-std=c++20", "-O3", "-Wall", "-Werror",
"-I../src", "-Iuunit",
"-DOUTPUT=\"source_type\"",
},
@@ -61,11 +167,13 @@ BuildConfigurations ctorTestConfigs(const Settings& settings)
},
},
{
- .type = TargetType::UnitTest,
+ .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" },
@@ -78,12 +186,15 @@ BuildConfigurations ctorTestConfigs(const Settings& settings)
},
},
{
- .type = TargetType::UnitTestLib,
+ .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",
@@ -98,7 +209,7 @@ BuildConfigurations ctorTestConfigs(const Settings& settings)
},
.flags = {
.cxxflags = {
- "-std=c++20", "-O3", "-s", "-Wall", "-Werror",
+ "-std=c++20", "-O3", "-Wall", "-Werror",
"-I../src",
},
.ldflags = { "-pthread" },