diff options
Diffstat (limited to 'test/tools_test.cc')
-rw-r--r-- | test/tools_test.cc | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/test/tools_test.cc b/test/tools_test.cc index a428ea1..15270b3 100644 --- a/test/tools_test.cc +++ b/test/tools_test.cc @@ -22,6 +22,9 @@ std::ostream& operator<<(std::ostream& stream, const ctor::toolchain& toolchain) case ctor::toolchain::clang: stream << "ctor::toolchain::clang"; break; + case ctor::toolchain::msvc: + stream << "ctor::toolchain::msvc"; + break; } return stream; } @@ -114,33 +117,27 @@ bool operator!=(const ctor::asm_flag& a, const ctor::asm_flag& b) #include <uunit.h> -namespace { -std::string conf_host_cxx{}; -std::string conf_build_cxx{}; -} - const ctor::configuration& ctor::get_configuration() { static ctor::configuration cfg; return cfg; } -const std::string& ctor::configuration::get(const std::string& key, const std::string& defval) const +std::string ctor::configuration::get(const std::string& key, [[maybe_unused]]const std::string& default_value) const { if(key == ctor::cfg::host_cxx) { - return conf_host_cxx; + return {}; } if(key == ctor::cfg::build_cxx) { - return conf_build_cxx; + return {}; } assert(false); // bad key - static std::string res{}; - return res; + return {}; } class ToolsTest @@ -526,10 +523,6 @@ public: act = ld_option(ctor::toolchain::gcc, ctor::ld_opt::output, "foo"); uASSERT_EQUAL(exp, act); - exp = { "-s" }; - act = ld_option(ctor::toolchain::gcc, ctor::ld_opt::strip); - uASSERT_EQUAL(exp, act); - exp = { "-Wall" }; act = ld_option(ctor::toolchain::gcc, ctor::ld_opt::warn_all); uASSERT_EQUAL(exp, act); @@ -577,10 +570,6 @@ public: act = ld_option(ctor::toolchain::clang, ctor::ld_opt::output, "foo"); uASSERT_EQUAL(exp, act); - exp = { "-s" }; - act = ld_option(ctor::toolchain::clang, ctor::ld_opt::strip); - uASSERT_EQUAL(exp, act); - exp = { "-Wall" }; act = ld_option(ctor::toolchain::clang, ctor::ld_opt::warn_all); uASSERT_EQUAL(exp, act); @@ -628,10 +617,6 @@ public: act = ld_option(ctor::toolchain::any, ctor::ld_opt::output, "foo"); uASSERT_EQUAL(exp, act); - exp = { "{ctor::ld_opt::strip}" }; - act = ld_option(ctor::toolchain::any, ctor::ld_opt::strip); - uASSERT_EQUAL(exp, act); - exp = { "{ctor::ld_opt::warn_all}" }; act = ld_option(ctor::toolchain::any, ctor::ld_opt::warn_all); uASSERT_EQUAL(exp, act); @@ -914,7 +899,7 @@ public: // Mismatching toolchain (required vs actual) results in no output // otherwise to_strings is just a proxy for ld_option - act = to_strings(ctor::toolchain::gcc, {ctor::toolchain::clang, ctor::ld_opt::strip}); + act = to_strings(ctor::toolchain::gcc, {ctor::toolchain::clang, ctor::ld_opt::threads}); uASSERT_EQUAL(exp, act); } |