summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2026-02-07 22:27:05 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2026-02-08 17:25:52 +0100
commit627843d2517a5cc8885939d6396fb052cd873aa7 (patch)
treeb667b48327f127dd29ca160588ee5630d2ca4518 /test
parent668158a83bc9e5af7bf65fe88d22d1958e33443f (diff)
Use REG function for configuration, like with build_configurations, to get rid of the hacky weak symbol method.no_more_weak
Diffstat (limited to 'test')
-rw-r--r--test/ctor.cc7
-rw-r--r--test/source_type_test.cc3
-rw-r--r--test/tasks_test.cc4
-rw-r--r--test/tools_test.cc23
4 files changed, 8 insertions, 29 deletions
diff --git a/test/ctor.cc b/test/ctor.cc
index afec91c..d1c0188 100644
--- a/test/ctor.cc
+++ b/test/ctor.cc
@@ -31,6 +31,7 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
ctor::sources{
"generated_sources_test.cc",
"testmain.cc",
+ "../configuration.cc",
},
ctor::depends({"libctor_nomain.a"}),
ctor::cxx_flags{
@@ -146,6 +147,7 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
ctor::sources{
"cycle_test.cc",
"testmain.cc",
+ "../configuration.cc",
},
ctor::depends({"libctor_nomain.a"}),
ctor::cxx_flags{
@@ -163,6 +165,7 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
ctor::sources{
"source_type_test.cc",
"testmain.cc",
+ "../configuration.cc",
},
ctor::depends({"libctor_nomain.a"}),
ctor::cxx_flags{
@@ -180,8 +183,7 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
ctor::sources{
"tools_test.cc",
"testmain.cc",
- "../src/util.cc",
- "../src/tools.cc",
+ "../configuration.cc",
},
ctor::depends({"libctor_nomain.a"}),
ctor::cxx_flags{
@@ -212,7 +214,6 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"../src/tools.cc",
"../src/util.cc",
"../src/externals_manual.cc",
- "../configuration.cc",
},
ctor::cxx_flags{
"-std=c++20", "-O3", "-Wall",
diff --git a/test/source_type_test.cc b/test/source_type_test.cc
index 90e77cf..345c591 100644
--- a/test/source_type_test.cc
+++ b/test/source_type_test.cc
@@ -26,13 +26,14 @@ std::ostream& operator<<(std::ostream& stream, const ctor::language& lang)
return stream;
}
-const ctor::configuration& ctor::get_configuration()
+const ctor::configuration& test_configuration()
{
static ctor::configuration cfg{};
cfg.build_toolchain = ctor::toolchain::gcc;
cfg.build_arch = ctor::arch::unix;
return cfg;
}
+REG(test_configuration);
class TestableTaskCC
: public TaskCC
diff --git a/test/tasks_test.cc b/test/tasks_test.cc
index 32bed5a..c8e4cf8 100644
--- a/test/tasks_test.cc
+++ b/test/tasks_test.cc
@@ -38,14 +38,14 @@ namespace test_global {
ctor::toolchain toolchain{};
ctor::arch arch{};
}
-const ctor::configuration& ctor::get_configuration()
+const ctor::configuration& test_configuration()
{
static ctor::configuration cfg{};
cfg.build_toolchain = test_global::toolchain;
cfg.build_arch = test_global::arch;
return cfg;
}
-
+REG(test_configuration);
REG(ctorTestConfigs1);
REG(ctorTestConfigs2);
diff --git a/test/tools_test.cc b/test/tools_test.cc
index 5ae04c3..cfbcbce 100644
--- a/test/tools_test.cc
+++ b/test/tools_test.cc
@@ -114,29 +114,6 @@ bool operator!=(const ctor::asm_flag& a, const ctor::asm_flag& b)
#include <uunit.h>
-const ctor::configuration& ctor::get_configuration()
-{
- static ctor::configuration cfg;
- return cfg;
-}
-
-std::string ctor::configuration::get(const std::string& key, [[maybe_unused]]const std::string& default_value) const
-{
- if(key == ctor::cfg::host_cxx)
- {
- return {};
- }
-
- if(key == ctor::cfg::build_cxx)
- {
- return {};
- }
-
- assert(false); // bad key
-
- return {};
-}
-
class ToolsTest
: public uUnit
{