summaryrefslogtreecommitdiff
path: root/test/suite/ctor_files
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/suite/ctor_files
parent19d1dd34fbc87b6637147785332f180e36acdfef (diff)
New syntaxdevelop
Diffstat (limited to 'test/suite/ctor_files')
-rw-r--r--test/suite/ctor_files/ctor.cc.bar38
-rw-r--r--test/suite/ctor_files/ctor.cc.base38
-rw-r--r--test/suite/ctor_files/ctor.cc.generated73
-rw-r--r--test/suite/ctor_files/ctor.cc.generated239
-rw-r--r--test/suite/ctor_files/ctor.cc.multi38
5 files changed, 106 insertions, 120 deletions
diff --git a/test/suite/ctor_files/ctor.cc.bar b/test/suite/ctor_files/ctor.cc.bar
index ab88379..d77eb70 100644
--- a/test/suite/ctor_files/ctor.cc.bar
+++ b/test/suite/ctor_files/ctor.cc.bar
@@ -11,22 +11,20 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
return
{
{
- .name = "hello",
- .target = "hello",
- .sources = {
+ ctor::name("hello"),
+ ctor::target("hello"),
+ ctor::sources{
"hello.cc",
},
- .flags = {
- .cxxflags = {
- "-std=c++20",
- "-O3",
- "-g",
- "-Wall",
- "-Werror",
- "-fexceptions",
- },
+ ctor::cxx_flags{
+ "-std=c++20",
+ "-O3",
+ "-g",
+ "-Wall",
+ "-Werror",
+ "-fexceptions",
},
- .externals = {"bar"},
+ ctor::externals({"bar"}),
}
};
}
@@ -36,14 +34,12 @@ ctor::external_configurations ctorExtConfigs(const ctor::settings& settings)
return
{
{
- .name = "bar",
- .external = ctor::external_manual{
- .flags = {
- .cflags = { "-D_B_" },
- .cxxflags = { "-D_A_", "-DBAR"},
- .ldflags = { "-D_C_" },
- .asmflags = { "-D_D_" },
- },
+ ctor::name("bar"),
+ ctor::external_manual{
+ ctor::c_flags{ "-D_B_" },
+ ctor::cxx_flags{ "-D_A_", "-DBAR"},
+ ctor::ld_flags{ "-D_C_" },
+ ctor::asm_flags{ "-D_D_" },
},
// Creates --with-foo-prefix arg to configure which will be used for
// -L and -I flags.
diff --git a/test/suite/ctor_files/ctor.cc.base b/test/suite/ctor_files/ctor.cc.base
index a8b3c92..73b5cdb 100644
--- a/test/suite/ctor_files/ctor.cc.base
+++ b/test/suite/ctor_files/ctor.cc.base
@@ -11,22 +11,20 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
return
{
{
- .name = "hello",
- .target = "hello",
- .sources = {
+ ctor::name("hello"),
+ ctor::target("hello"),
+ ctor::sources{
"hello.cc",
},
- .flags = {
- .cxxflags = {
- "-std=c++20",
- "-O3",
- "-g",
- "-Wall",
- "-Werror",
- "-fexceptions",
- },
+ ctor::cxx_flags{
+ "-std=c++20",
+ "-O3",
+ "-g",
+ "-Wall",
+ "-Werror",
+ "-fexceptions",
},
- .externals = {"bar"},
+ ctor::externals({"bar"}),
}
};
}
@@ -36,15 +34,13 @@ ctor::external_configurations ctorExtConfigs(const ctor::settings& settings)
return
{
{
- .name = "bar",
- .external = ctor::external_manual
+ ctor::name("bar"),
+ ctor::external_manual
{
- .flags = {
- .cflags = { "-D_B_" },
- .cxxflags = { "-D_A_", "-DFOO"},
- .ldflags = { "-D_C_" },
- .asmflags = { "-D_D_" },
- },
+ ctor::c_flags{ "-D_B_" },
+ ctor::cxx_flags{ "-D_A_", "-DFOO"},
+ ctor::ld_flags{ "-D_C_" },
+ ctor::asm_flags{ "-D_D_" },
},
// Creates --with-foo-prefix arg to configure which will be used for
// -L and -I flags.
diff --git a/test/suite/ctor_files/ctor.cc.generated b/test/suite/ctor_files/ctor.cc.generated
index d4b9786..96b6fb5 100644
--- a/test/suite/ctor_files/ctor.cc.generated
+++ b/test/suite/ctor_files/ctor.cc.generated
@@ -13,72 +13,69 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
return
{
{
- .target = "world",
- .sources = {
+ ctor::target("world"),
+ ctor::sources{
{ "world.cc", ctor::source_type::generated },
},
- .flags = {
- .cxxflags = {
- "-std=c++20",
- "-O3",
- "-g",
- "-Wall",
- "-Werror",
- "-fexceptions",
- },
+ ctor::cxx_flags{
+ "-std=c++20",
+ "-O3",
+ "-g",
+ "-Wall",
+ "-Werror",
+ "-fexceptions",
},
},
{
- .target = "foo",
- .sources = {
+ ctor::target("foo"),
+ ctor::sources{
{ "foo.cc", ctor::source_type::generated },
},
- .flags = {
- .cxxflags = {
- "-std=c++20",
- "-O3",
- "-g",
- "-Wall",
- "-Werror",
- "-fexceptions",
- },
+ ctor::cxx_flags{
+ "-std=c++20",
+ "-O3",
+ "-g",
+ "-Wall",
+ "-Werror",
+ "-fexceptions",
},
},
{
- .target = "this_is_unused",
- .sources = {
+ ctor::target("this_is_unused"),
+ ctor::sources{
{"hello.cc", ctor::output_file{"world.cc"}},
{"hello.cc", ctor::output_file{"foo.cc"}},
},
- .function = [](const std::string& input,
- const std::string& output,
- const ctor::build_configuration& config,
- const ctor::settings& settings)
+ [](const std::string& input,
+ const std::string& output,
+ const ctor::build_configuration& config,
+ const ctor::settings& settings)
{
namespace fs = std::filesystem;
std::cout << "Input: " << input << '\n';
std::cout << "Output: " << output << '\n';
fs::copy_file(input, output, fs::copy_options::overwrite_existing);
return 0;
- }
+ },
},
{
- .target = "many_to_one",
- .sources = {
+ ctor::target("many_to_one"),
+ ctor::sources{
{"many_to_one.cc", ctor::source_type::generated}
- }
+ },
+ ctor::cxx_flags{"-fexceptions"},
},
{
- .target = "many_to_one.cc",
- .sources = {
+ ctor::target("many_to_one.cc"),
+ ctor::sources{
{"foo.cc", ctor::source_type::generated},
{"hello.cc"},
},
- .function = [](const std::vector<std::string>& input,
- const std::string& output,
- const ctor::build_configuration& config,
- const ctor::settings& settings)
+ [](const std::vector<std::string>& input,
+ const std::string& output,
+ const ctor::build_configuration& config,
+ const ctor::settings& settings)
{
std::cout << "Output: " << output << '\n';
std::ofstream ofs(output);
diff --git a/test/suite/ctor_files/ctor.cc.generated2 b/test/suite/ctor_files/ctor.cc.generated2
index c78489f..2e36c0e 100644
--- a/test/suite/ctor_files/ctor.cc.generated2
+++ b/test/suite/ctor_files/ctor.cc.generated2
@@ -13,27 +13,27 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
return
{
{
- .target = "world",
- .sources = {
+ ctor::target("world"),
+ ctor::sources{
{ "world.cc", ctor::source_type::generated },
},
},
{
- .target = "foo",
- .sources = {
+ ctor::target("foo"),
+ ctor::sources{
{ "foo.cc", ctor::source_type::generated },
},
},
{
- .target = "this_is_unused",
- .sources = {
+ ctor::target("this_is_unused"),
+ ctor::sources{
{"hello.cc", ctor::output_file{"world.cc"}},
{"hello.cc", ctor::output_file{"foo.cc"}},
},
- .function = [](const std::string& input,
- const std::string& output,
- const ctor::build_configuration& config,
- const ctor::settings& settings)
+ [](const std::string& input,
+ const std::string& output,
+ const ctor::build_configuration& config,
+ const ctor::settings& settings)
{
namespace fs = std::filesystem;
std::cout << "Input: " << input << '\n';
@@ -44,20 +44,21 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
},
{
- .target = "many_to_one",
- .sources = {
+ ctor::target("many_to_one"),
+ ctor::sources{
{"many_to_one.cc", ctor::source_type::generated}
- }
+ },
+ ctor::cxx_flags{ "-fexceptions", },
},
{
- .target = "many_to_one.cc",
- .sources = {
+ ctor::target("many_to_one.cc"),
+ ctor::sources{
{"hello.cc"},
},
- .function = [](const std::vector<std::string>& input,
- const std::string& output,
- const ctor::build_configuration& config,
- const ctor::settings& settings)
+ [](const std::vector<std::string>& input,
+ const std::string& output,
+ const ctor::build_configuration& config,
+ const ctor::settings& settings)
{
std::cout << "Output: " << output << '\n';
std::ofstream ofs(output);
diff --git a/test/suite/ctor_files/ctor.cc.multi b/test/suite/ctor_files/ctor.cc.multi
index 157d96c..fc4c7a4 100644
--- a/test/suite/ctor_files/ctor.cc.multi
+++ b/test/suite/ctor_files/ctor.cc.multi
@@ -13,22 +13,20 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
return
{
{
- .name = "hello",
- .target = "hello",
- .sources = {
+ ctor::name("hello"),
+ ctor::target("hello"),
+ ctor::sources{
"hello.cc",
},
- .flags = {
- .cxxflags = {
- "-std=c++20",
- "-O3",
- "-g",
- "-Wall",
- "-Werror",
- "-fexceptions",
- },
+ ctor::cxx_flags{
+ "-std=c++20",
+ "-O3",
+ "-g",
+ "-Wall",
+ "-Werror",
+ "-fexceptions",
},
- .externals = {"bar"},
+ ctor::externals({"bar"}),
}
};
}
@@ -38,14 +36,12 @@ ctor::external_configurations ctorExtConfigs(const ctor::settings& settings)
return
{
{
- .name = "bar",
- .external = ctor::external_manual{
- .flags = {
- .cflags = { "-D_B_" },
- .cxxflags = { "-D_A_", "-DFOO"},
- .ldflags = { "-D_C_" },
- .asmflags = { "-D_D_" },
- },
+ ctor::name("bar"),
+ ctor::external_manual{
+ ctor::c_flags{ "-D_B_" },
+ ctor::cxx_flags{ "-D_A_", "-DFOO"},
+ ctor::ld_flags{ "-D_C_" },
+ ctor::asm_flags{ "-D_D_" },
},
// Creates --with-foo-prefix arg to configure which will be used for
// -L and -I flags.