summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ctor.cc148
-rw-r--r--test/generated_sources_test.cc18
-rw-r--r--test/suite/ctor_files/ctor.cc.bar16
-rw-r--r--test/suite/ctor_files/ctor.cc.base16
-rw-r--r--test/suite/ctor_files/ctor.cc.generated55
-rw-r--r--test/suite/ctor_files/ctor.cc.generated223
-rw-r--r--test/suite/ctor_files/ctor.cc.multi16
7 files changed, 130 insertions, 162 deletions
diff --git a/test/ctor.cc b/test/ctor.cc
index 440ddfe..afec91c 100644
--- a/test/ctor.cc
+++ b/test/ctor.cc
@@ -17,13 +17,11 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"argparser_test.cc",
"testmain.cc",
},
- ctor::flags{
- ctor::cxx_flags{
- "-std=c++20", "-O3", "-Wall",
- "-I../src", "-Iuunit",
- "-DOUTPUT=\"argparser\"",
- "-fexceptions",
- },
+ ctor::cxx_flags{
+ "-std=c++20", "-O3", "-Wall",
+ "-I../src", "-Iuunit",
+ "-DOUTPUT=\"argparser\"",
+ "-fexceptions",
},
},
{
@@ -35,13 +33,11 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"testmain.cc",
},
ctor::depends({"libctor_nomain.a"}),
- ctor::flags{
- ctor::cxx_flags{
- "-std=c++20", "-O3", "-Wall",
- "-I../src", "-Iuunit",
- "-DOUTPUT=\"generated_sources\"",
- "-fexceptions",
- },
+ ctor::cxx_flags{
+ "-std=c++20", "-O3", "-Wall",
+ "-I../src", "-Iuunit",
+ "-DOUTPUT=\"generated_sources\"",
+ "-fexceptions",
},
},
{
@@ -53,13 +49,11 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"testmain.cc",
"../src/util.cc",
},
- ctor::flags{
- ctor::cxx_flags{
- "-std=c++20", "-O3", "-Wall",
- "-I../src", "-Iuunit",
- "-DOUTPUT=\"argsplit\"",
- "-fexceptions",
- },
+ ctor::cxx_flags{
+ "-std=c++20", "-O3", "-Wall",
+ "-I../src", "-Iuunit",
+ "-DOUTPUT=\"argsplit\"",
+ "-fexceptions",
},
},
{
@@ -71,13 +65,11 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"testmain.cc",
"../src/pointerlist.cc",
},
- ctor::flags{
- ctor::cxx_flags{
- "-std=c++20", "-O3", "-Wall",
- "-I../src", "-Iuunit",
- "-DOUTPUT=\"pointerlist\"",
- "-fexceptions",
- },
+ ctor::cxx_flags{
+ "-std=c++20", "-O3", "-Wall",
+ "-I../src", "-Iuunit",
+ "-DOUTPUT=\"pointerlist\"",
+ "-fexceptions",
},
},
{
@@ -91,13 +83,11 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"../src/util.cc",
},
ctor::depends({"testprog"}),
- ctor::flags{
- ctor::cxx_flags{
- "-std=c++20", "-O3", "-Wall",
- "-I../src", "-Iuunit",
- "-DOUTPUT=\"deps\"",
- "-fexceptions",
- },
+ ctor::cxx_flags{
+ "-std=c++20", "-O3", "-Wall",
+ "-I../src", "-Iuunit",
+ "-DOUTPUT=\"deps\"",
+ "-fexceptions",
},
},
{
@@ -107,11 +97,9 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
ctor::sources{
"testprog.cc",
},
- ctor::flags{
- ctor::cxx_flags{
- "-std=c++20", "-O3", "-Wall",
- "-fexceptions",
- },
+ ctor::cxx_flags{
+ "-std=c++20", "-O3", "-Wall",
+ "-fexceptions",
},
},
{
@@ -126,15 +114,13 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"../src/util.cc",
},
ctor::depends({"testprog"}),
- ctor::flags{
- ctor::cxx_flags{
- "-std=c++20", "-O3", "-Wall",
- "-I../src", "-Iuunit",
- "-DOUTPUT=\"execute\"",
- "-fexceptions",
- },
- ctor::ld_flags{ "-pthread" },
+ ctor::cxx_flags{
+ "-std=c++20", "-O3", "-Wall",
+ "-I../src", "-Iuunit",
+ "-DOUTPUT=\"execute\"",
+ "-fexceptions",
},
+ ctor::ld_flags{ "-pthread" },
},
{
ctor::target_type::unit_test,
@@ -145,15 +131,13 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"testmain.cc",
},
ctor::depends({"libctor_nomain.a"}),
- ctor::flags{
- ctor::cxx_flags{
- "-std=c++20", "-O3", "-Wall",
- "-I../src", "-Iuunit",
- "-DOUTPUT=\"tasks\"",
- "-fexceptions",
- },
- ctor::ld_flags{ "-pthread" },
+ ctor::cxx_flags{
+ "-std=c++20", "-O3", "-Wall",
+ "-I../src", "-Iuunit",
+ "-DOUTPUT=\"tasks\"",
+ "-fexceptions",
},
+ ctor::ld_flags{ "-pthread" },
},
{
ctor::target_type::unit_test,
@@ -164,15 +148,13 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"testmain.cc",
},
ctor::depends({"libctor_nomain.a"}),
- ctor::flags{
- ctor::cxx_flags{
- "-std=c++20", "-O3", "-Wall",
- "-I../src", "-Iuunit",
- "-DOUTPUT=\"cycle\"",
- "-fexceptions",
- },
- ctor::ld_flags{ "-pthread" },
+ ctor::cxx_flags{
+ "-std=c++20", "-O3", "-Wall",
+ "-I../src", "-Iuunit",
+ "-DOUTPUT=\"cycle\"",
+ "-fexceptions",
},
+ ctor::ld_flags{ "-pthread" },
},
{
ctor::target_type::unit_test,
@@ -183,15 +165,13 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"testmain.cc",
},
ctor::depends({"libctor_nomain.a"}),
- ctor::flags{
- ctor::cxx_flags{
- "-std=c++20", "-O3", "-Wall",
- "-I../src", "-Iuunit",
- "-DOUTPUT=\"source_type\"",
- "-fexceptions",
- },
- ctor::ld_flags{ "-pthread" },
+ ctor::cxx_flags{
+ "-std=c++20", "-O3", "-Wall",
+ "-I../src", "-Iuunit",
+ "-DOUTPUT=\"source_type\"",
+ "-fexceptions",
},
+ ctor::ld_flags{ "-pthread" },
},
{
ctor::target_type::unit_test,
@@ -204,13 +184,11 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"../src/tools.cc",
},
ctor::depends({"libctor_nomain.a"}),
- ctor::flags{
- ctor::cxx_flags{
- "-std=c++20", "-O3", "-Wall",
- "-I../src", "-Iuunit",
- "-DOUTPUT=\"tools\"",
- "-fexceptions",
- },
+ ctor::cxx_flags{
+ "-std=c++20", "-O3", "-Wall",
+ "-I../src", "-Iuunit",
+ "-DOUTPUT=\"tools\"",
+ "-fexceptions",
},
},
{
@@ -236,14 +214,12 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"../src/externals_manual.cc",
"../configuration.cc",
},
- ctor::flags{
- ctor::cxx_flags{
- "-std=c++20", "-O3", "-Wall",
- "-I../src",
- "-fexceptions",
- },
- ctor::ld_flags{ "-pthread" },
+ ctor::cxx_flags{
+ "-std=c++20", "-O3", "-Wall",
+ "-I../src",
+ "-fexceptions",
},
+ ctor::ld_flags{ "-pthread" },
},
};
}
diff --git a/test/generated_sources_test.cc b/test/generated_sources_test.cc
index 626a102..29a48fc 100644
--- a/test/generated_sources_test.cc
+++ b/test/generated_sources_test.cc
@@ -43,13 +43,13 @@ public:
{"bar.x", ctor::output_file{"foo.cc"}},
{"bar.y", ctor::output_file{"bar.cc"}},
},
- ctor::GeneratorOneToOne([]([[maybe_unused]]const std::string& input,
+ []([[maybe_unused]]const std::string& input,
[[maybe_unused]]const std::string& output,
[[maybe_unused]]const ctor::build_configuration& config,
[[maybe_unused]]const ctor::settings& settings)
{
return 0;
- }),
+ },
},
};
});
@@ -93,16 +93,16 @@ public:
{
ctor::target("foo.cc"),
ctor::sources{
- {"bar.x"},
- {"bar.y"},
+ "bar.x",
+ "bar.y",
},
- ctor::GeneratorManyToOne([](const std::vector<std::string>& input,
- const std::string& output,
- const ctor::build_configuration& config,
- const ctor::settings& settings)
+ []([[maybe_unused]]const std::vector<std::string>& input,
+ [[maybe_unused]]const std::string& output,
+ [[maybe_unused]]const ctor::build_configuration& config,
+ [[maybe_unused]]const ctor::settings& settings)
{
return 0;
- }),
+ },
},
};
});
diff --git a/test/suite/ctor_files/ctor.cc.bar b/test/suite/ctor_files/ctor.cc.bar
index 2342c3a..f73f400 100644
--- a/test/suite/ctor_files/ctor.cc.bar
+++ b/test/suite/ctor_files/ctor.cc.bar
@@ -16,15 +16,13 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
ctor::sources{
"hello.cc",
},
- ctor::flags{
- ctor::cxx_flags{
- "-std=c++20",
- "-O3",
- "-g",
- "-Wall",
- "-Werror",
- "-fexceptions",
- },
+ ctor::cxx_flags{
+ "-std=c++20",
+ "-O3",
+ "-g",
+ "-Wall",
+ "-Werror",
+ "-fexceptions",
},
ctor::externals({"bar"}),
}
diff --git a/test/suite/ctor_files/ctor.cc.base b/test/suite/ctor_files/ctor.cc.base
index 3734415..cc06e85 100644
--- a/test/suite/ctor_files/ctor.cc.base
+++ b/test/suite/ctor_files/ctor.cc.base
@@ -16,15 +16,13 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
ctor::sources{
"hello.cc",
},
- ctor::flags{
- ctor::cxx_flags{
- "-std=c++20",
- "-O3",
- "-g",
- "-Wall",
- "-Werror",
- "-fexceptions",
- },
+ ctor::cxx_flags{
+ "-std=c++20",
+ "-O3",
+ "-g",
+ "-Wall",
+ "-Werror",
+ "-fexceptions",
},
ctor::externals({"bar"}),
}
diff --git a/test/suite/ctor_files/ctor.cc.generated b/test/suite/ctor_files/ctor.cc.generated
index fe7e173..96b6fb5 100644
--- a/test/suite/ctor_files/ctor.cc.generated
+++ b/test/suite/ctor_files/ctor.cc.generated
@@ -17,15 +17,13 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
ctor::sources{
{ "world.cc", ctor::source_type::generated },
},
- ctor::flags{
- ctor::cxx_flags{
- "-std=c++20",
- "-O3",
- "-g",
- "-Wall",
- "-Werror",
- "-fexceptions",
- },
+ ctor::cxx_flags{
+ "-std=c++20",
+ "-O3",
+ "-g",
+ "-Wall",
+ "-Werror",
+ "-fexceptions",
},
},
{
@@ -33,15 +31,13 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
ctor::sources{
{ "foo.cc", ctor::source_type::generated },
},
- ctor::flags{
- ctor::cxx_flags{
- "-std=c++20",
- "-O3",
- "-g",
- "-Wall",
- "-Werror",
- "-fexceptions",
- },
+ ctor::cxx_flags{
+ "-std=c++20",
+ "-O3",
+ "-g",
+ "-Wall",
+ "-Werror",
+ "-fexceptions",
},
},
{
@@ -50,24 +46,25 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
{"hello.cc", ctor::output_file{"world.cc"}},
{"hello.cc", ctor::output_file{"foo.cc"}},
},
- ctor::GeneratorOneToOne{[](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;
- }}
+ },
},
{
ctor::target("many_to_one"),
ctor::sources{
{"many_to_one.cc", ctor::source_type::generated}
- }
+ },
+ ctor::cxx_flags{"-fexceptions"},
},
{
ctor::target("many_to_one.cc"),
@@ -75,10 +72,10 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
{"foo.cc", ctor::source_type::generated},
{"hello.cc"},
},
- ctor::GeneratorManyToOne{[](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);
@@ -97,7 +94,7 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
}
ofs << "*/\n";
return 0;
- }}
+ }
},
};
diff --git a/test/suite/ctor_files/ctor.cc.generated2 b/test/suite/ctor_files/ctor.cc.generated2
index acda99f..2e36c0e 100644
--- a/test/suite/ctor_files/ctor.cc.generated2
+++ b/test/suite/ctor_files/ctor.cc.generated2
@@ -30,34 +30,35 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
{"hello.cc", ctor::output_file{"world.cc"}},
{"hello.cc", ctor::output_file{"foo.cc"}},
},
- ctor::GeneratorOneToOne{[](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;
- }}
+ }
},
{
ctor::target("many_to_one"),
ctor::sources{
{"many_to_one.cc", ctor::source_type::generated}
- }
+ },
+ ctor::cxx_flags{ "-fexceptions", },
},
{
ctor::target("many_to_one.cc"),
ctor::sources{
{"hello.cc"},
},
- ctor::GeneratorManyToOne{[](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);
@@ -76,7 +77,7 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
}
ofs << "*/\n";
return 0;
- }}
+ }
},
};
diff --git a/test/suite/ctor_files/ctor.cc.multi b/test/suite/ctor_files/ctor.cc.multi
index cf86703..e45ad45 100644
--- a/test/suite/ctor_files/ctor.cc.multi
+++ b/test/suite/ctor_files/ctor.cc.multi
@@ -18,15 +18,13 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
ctor::sources{
"hello.cc",
},
- ctor::flags{
- ctor::cxx_flags{
- "-std=c++20",
- "-O3",
- "-g",
- "-Wall",
- "-Werror",
- "-fexceptions",
- },
+ ctor::cxx_flags{
+ "-std=c++20",
+ "-O3",
+ "-g",
+ "-Wall",
+ "-Werror",
+ "-fexceptions",
},
ctor::externals({"bar"}),
}