summaryrefslogtreecommitdiff
path: root/test/tools_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/tools_test.cc')
-rw-r--r--test/tools_test.cc315
1 files changed, 159 insertions, 156 deletions
diff --git a/test/tools_test.cc b/test/tools_test.cc
index a428ea1..91da470 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;
}
@@ -125,7 +128,7 @@ const ctor::configuration& ctor::get_configuration()
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)
{
@@ -175,24 +178,24 @@ public:
//
// gcc
//
- uASSERT_EQUAL(ctor::toolchain::gcc, getToolChain("/usr/bin/gcc"));
- uASSERT_EQUAL(ctor::toolchain::gcc, getToolChain("/usr/bin/gcc-10"));
- uASSERT_EQUAL(ctor::toolchain::gcc, getToolChain("/usr/bin/x86_64-pc-linux-gnu-g++-9.3.0"));
+ assert_equal(ctor::toolchain::gcc, getToolChain("/usr/bin/gcc"), __FILE__, __LINE__);
+ assert_equal(ctor::toolchain::gcc, getToolChain("/usr/bin/gcc-10"), __FILE__, __LINE__);
+ assert_equal(ctor::toolchain::gcc, getToolChain("/usr/bin/x86_64-pc-linux-gnu-g++-9.3.0"), __FILE__, __LINE__);
- uASSERT_EQUAL(ctor::toolchain::gcc, getToolChain("/usr/bin/g++"));
- uASSERT_EQUAL(ctor::toolchain::gcc, getToolChain("/usr/bin/g++-10"));
- uASSERT_EQUAL(ctor::toolchain::gcc, getToolChain("/usr/bin/x86_64-pc-linux-gnu-g++-9.3.0"));
+ assert_equal(ctor::toolchain::gcc, getToolChain("/usr/bin/g++"), __FILE__, __LINE__);
+ assert_equal(ctor::toolchain::gcc, getToolChain("/usr/bin/g++-10"), __FILE__, __LINE__);
+ assert_equal(ctor::toolchain::gcc, getToolChain("/usr/bin/x86_64-pc-linux-gnu-g++-9.3.0"), __FILE__, __LINE__);
//
// clang
//
- uASSERT_EQUAL(ctor::toolchain::clang, getToolChain("/usr/bin/clang"));
- uASSERT_EQUAL(ctor::toolchain::clang, getToolChain("/usr/bin/clang-16"));
- uASSERT_EQUAL(ctor::toolchain::clang, getToolChain("/usr/lib/llvm/16/bin/i686-pc-linux-gnu-clang-16"));
+ assert_equal(ctor::toolchain::clang, getToolChain("/usr/bin/clang"), __FILE__, __LINE__);
+ assert_equal(ctor::toolchain::clang, getToolChain("/usr/bin/clang-16"), __FILE__, __LINE__);
+ assert_equal(ctor::toolchain::clang, getToolChain("/usr/lib/llvm/16/bin/i686-pc-linux-gnu-clang-16"), __FILE__, __LINE__);
- uASSERT_EQUAL(ctor::toolchain::clang, getToolChain("/usr/bin/clang++"));
- uASSERT_EQUAL(ctor::toolchain::clang, getToolChain("/usr/bin/clang++-16"));
- uASSERT_EQUAL(ctor::toolchain::clang, getToolChain("/usr/lib/llvm/16/bin/i686-pc-linux-gnu-clang++-16"));
+ assert_equal(ctor::toolchain::clang, getToolChain("/usr/bin/clang++"), __FILE__, __LINE__);
+ assert_equal(ctor::toolchain::clang, getToolChain("/usr/bin/clang++-16"), __FILE__, __LINE__);
+ assert_equal(ctor::toolchain::clang, getToolChain("/usr/lib/llvm/16/bin/i686-pc-linux-gnu-clang++-16"), __FILE__, __LINE__);
}
@@ -206,153 +209,153 @@ public:
//
exp = { "-o", "foo" };
act = c_option(ctor::toolchain::gcc, ctor::c_opt::output, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-g" };
act = c_option(ctor::toolchain::gcc, ctor::c_opt::debug);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Wall" };
act = c_option(ctor::toolchain::gcc, ctor::c_opt::warn_all);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Werror" };
act = c_option(ctor::toolchain::gcc, ctor::c_opt::warnings_as_errors);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-MMD" };
act = c_option(ctor::toolchain::gcc, ctor::c_opt::generate_dep_tree);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-c" };
act = c_option(ctor::toolchain::gcc, ctor::c_opt::no_link);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Ifoo" };
act = c_option(ctor::toolchain::gcc, ctor::c_opt::include_path, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-std=foo" };
act = c_option(ctor::toolchain::gcc, ctor::c_opt::c_std, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Ofoo" };
act = c_option(ctor::toolchain::gcc, ctor::c_opt::optimization, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-fPIC" };
act = c_option(ctor::toolchain::gcc, ctor::c_opt::position_independent_code);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-fPIE" };
act = c_option(ctor::toolchain::gcc, ctor::c_opt::position_independent_executable);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-foo" };
act = c_option(ctor::toolchain::gcc, ctor::c_opt::custom, "-foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
//
// clang
//
exp = { "-o", "foo" };
act = c_option(ctor::toolchain::clang, ctor::c_opt::output, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-g" };
act = c_option(ctor::toolchain::clang, ctor::c_opt::debug);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Wall" };
act = c_option(ctor::toolchain::clang, ctor::c_opt::warn_all);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Werror" };
act = c_option(ctor::toolchain::clang, ctor::c_opt::warnings_as_errors);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-MMD" };
act = c_option(ctor::toolchain::clang, ctor::c_opt::generate_dep_tree);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-c" };
act = c_option(ctor::toolchain::clang, ctor::c_opt::no_link);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Ifoo" };
act = c_option(ctor::toolchain::clang, ctor::c_opt::include_path, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-std=foo" };
act = c_option(ctor::toolchain::clang, ctor::c_opt::c_std, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Ofoo" };
act = c_option(ctor::toolchain::clang, ctor::c_opt::optimization, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-fPIC" };
act = c_option(ctor::toolchain::clang, ctor::c_opt::position_independent_code);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-fPIE" };
act = c_option(ctor::toolchain::clang, ctor::c_opt::position_independent_executable);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-foo" };
act = c_option(ctor::toolchain::clang, ctor::c_opt::custom, "-foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
//
// any
//
exp = { "{ctor::c_opt::output, \"foo\"}" };
act = c_option(ctor::toolchain::any, ctor::c_opt::output, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::c_opt::debug}" };
act = c_option(ctor::toolchain::any, ctor::c_opt::debug);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::c_opt::warn_all}" };
act = c_option(ctor::toolchain::any, ctor::c_opt::warn_all);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::c_opt::warnings_as_errors}" };
act = c_option(ctor::toolchain::any, ctor::c_opt::warnings_as_errors);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::c_opt::generate_dep_tree}" };
act = c_option(ctor::toolchain::any, ctor::c_opt::generate_dep_tree);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::c_opt::no_link}" };
act = c_option(ctor::toolchain::any, ctor::c_opt::no_link);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::c_opt::include_path, \"foo\"}" };
act = c_option(ctor::toolchain::any, ctor::c_opt::include_path, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::c_opt::c_std, \"foo\"}" };
act = c_option(ctor::toolchain::any, ctor::c_opt::c_std, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::c_opt::optimization, \"foo\"}" };
act = c_option(ctor::toolchain::any, ctor::c_opt::optimization, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::c_opt::position_independent_code}" };
act = c_option(ctor::toolchain::any, ctor::c_opt::position_independent_code);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::c_opt::position_independent_executable}" };
act = c_option(ctor::toolchain::any, ctor::c_opt::position_independent_executable);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::c_opt::custom, \"-foo\"}" };
act = c_option(ctor::toolchain::any, ctor::c_opt::custom, "-foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
}
void getOption_toolchain_cxx_test()
@@ -365,153 +368,153 @@ public:
//
exp = { "-o", "foo" };
act = cxx_option(ctor::toolchain::gcc, ctor::cxx_opt::output, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-g" };
act = cxx_option(ctor::toolchain::gcc, ctor::cxx_opt::debug);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Wall" };
act = cxx_option(ctor::toolchain::gcc, ctor::cxx_opt::warn_all);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Werror" };
act = cxx_option(ctor::toolchain::gcc, ctor::cxx_opt::warnings_as_errors);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-MMD" };
act = cxx_option(ctor::toolchain::gcc, ctor::cxx_opt::generate_dep_tree);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-c" };
act = cxx_option(ctor::toolchain::gcc, ctor::cxx_opt::no_link);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Ifoo" };
act = cxx_option(ctor::toolchain::gcc, ctor::cxx_opt::include_path, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-std=foo" };
act = cxx_option(ctor::toolchain::gcc, ctor::cxx_opt::cpp_std, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Ofoo" };
act = cxx_option(ctor::toolchain::gcc, ctor::cxx_opt::optimization, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-fPIC" };
act = cxx_option(ctor::toolchain::gcc, ctor::cxx_opt::position_independent_code);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-fPIE" };
act = cxx_option(ctor::toolchain::gcc, ctor::cxx_opt::position_independent_executable);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-foo" };
act = cxx_option(ctor::toolchain::gcc, ctor::cxx_opt::custom, "-foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
//
// clang
//
exp = { "-o", "foo" };
act = cxx_option(ctor::toolchain::clang, ctor::cxx_opt::output, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-g" };
act = cxx_option(ctor::toolchain::clang, ctor::cxx_opt::debug);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Wall" };
act = cxx_option(ctor::toolchain::clang, ctor::cxx_opt::warn_all);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Werror" };
act = cxx_option(ctor::toolchain::clang, ctor::cxx_opt::warnings_as_errors);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-MMD" };
act = cxx_option(ctor::toolchain::clang, ctor::cxx_opt::generate_dep_tree);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-c" };
act = cxx_option(ctor::toolchain::clang, ctor::cxx_opt::no_link);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Ifoo" };
act = cxx_option(ctor::toolchain::clang, ctor::cxx_opt::include_path, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-std=foo" };
act = cxx_option(ctor::toolchain::clang, ctor::cxx_opt::cpp_std, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Ofoo" };
act = cxx_option(ctor::toolchain::clang, ctor::cxx_opt::optimization, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-fPIC" };
act = cxx_option(ctor::toolchain::clang, ctor::cxx_opt::position_independent_code);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-fPIE" };
act = cxx_option(ctor::toolchain::clang, ctor::cxx_opt::position_independent_executable);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-foo" };
act = cxx_option(ctor::toolchain::clang, ctor::cxx_opt::custom, "-foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
//
// any
//
exp = { "{ctor::cxx_opt::output, \"foo\"}" };
act = cxx_option(ctor::toolchain::any, ctor::cxx_opt::output, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::cxx_opt::debug}" };
act = cxx_option(ctor::toolchain::any, ctor::cxx_opt::debug);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::cxx_opt::warn_all}" };
act = cxx_option(ctor::toolchain::any, ctor::cxx_opt::warn_all);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::cxx_opt::warnings_as_errors}" };
act = cxx_option(ctor::toolchain::any, ctor::cxx_opt::warnings_as_errors);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::cxx_opt::generate_dep_tree}" };
act = cxx_option(ctor::toolchain::any, ctor::cxx_opt::generate_dep_tree);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::cxx_opt::no_link}" };
act = cxx_option(ctor::toolchain::any, ctor::cxx_opt::no_link);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::cxx_opt::include_path, \"foo\"}" };
act = cxx_option(ctor::toolchain::any, ctor::cxx_opt::include_path, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::cxx_opt::cpp_std, \"foo\"}" };
act = cxx_option(ctor::toolchain::any, ctor::cxx_opt::cpp_std, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::cxx_opt::optimization, \"foo\"}" };
act = cxx_option(ctor::toolchain::any, ctor::cxx_opt::optimization, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::cxx_opt::position_independent_code}" };
act = cxx_option(ctor::toolchain::any, ctor::cxx_opt::position_independent_code);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::cxx_opt::position_independent_executable}" };
act = cxx_option(ctor::toolchain::any, ctor::cxx_opt::position_independent_executable);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::cxx_opt::custom, \"-foo\"}" };
act = cxx_option(ctor::toolchain::any, ctor::cxx_opt::custom, "-foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
}
void getOption_toolchain_ld_test()
@@ -524,153 +527,153 @@ public:
//
exp = { "-o", "foo" };
act = ld_option(ctor::toolchain::gcc, ctor::ld_opt::output, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-s" };
act = ld_option(ctor::toolchain::gcc, ctor::ld_opt::strip);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Wall" };
act = ld_option(ctor::toolchain::gcc, ctor::ld_opt::warn_all);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Werror" };
act = ld_option(ctor::toolchain::gcc, ctor::ld_opt::warnings_as_errors);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Lfoo" };
act = ld_option(ctor::toolchain::gcc, ctor::ld_opt::library_path, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-lfoo" };
act = ld_option(ctor::toolchain::gcc, ctor::ld_opt::link, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-std=foo" };
act = ld_option(ctor::toolchain::gcc, ctor::ld_opt::cpp_std, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-shared" };
act = ld_option(ctor::toolchain::gcc, ctor::ld_opt::build_shared);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-pthread" };
act = ld_option(ctor::toolchain::gcc, ctor::ld_opt::threads);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-fPIC" };
act = ld_option(ctor::toolchain::gcc, ctor::ld_opt::position_independent_code);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-fPIE" };
act = ld_option(ctor::toolchain::gcc, ctor::ld_opt::position_independent_executable);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-foo" };
act = ld_option(ctor::toolchain::gcc, ctor::ld_opt::custom, "-foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
//
// clang
//
exp = { "-o", "foo" };
act = ld_option(ctor::toolchain::clang, ctor::ld_opt::output, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-s" };
act = ld_option(ctor::toolchain::clang, ctor::ld_opt::strip);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Wall" };
act = ld_option(ctor::toolchain::clang, ctor::ld_opt::warn_all);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Werror" };
act = ld_option(ctor::toolchain::clang, ctor::ld_opt::warnings_as_errors);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-Lfoo" };
act = ld_option(ctor::toolchain::clang, ctor::ld_opt::library_path, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-lfoo" };
act = ld_option(ctor::toolchain::clang, ctor::ld_opt::link, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-std=foo" };
act = ld_option(ctor::toolchain::clang, ctor::ld_opt::cpp_std, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-shared" };
act = ld_option(ctor::toolchain::clang, ctor::ld_opt::build_shared);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-pthread" };
act = ld_option(ctor::toolchain::clang, ctor::ld_opt::threads);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-fPIC" };
act = ld_option(ctor::toolchain::clang, ctor::ld_opt::position_independent_code);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-fPIE" };
act = ld_option(ctor::toolchain::clang, ctor::ld_opt::position_independent_executable);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-foo" };
act = ld_option(ctor::toolchain::clang, ctor::ld_opt::custom, "-foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
//
// any
//
exp = { "{ctor::ld_opt::output, \"foo\"}" };
act = ld_option(ctor::toolchain::any, ctor::ld_opt::output, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::ld_opt::strip}" };
act = ld_option(ctor::toolchain::any, ctor::ld_opt::strip);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::ld_opt::warn_all}" };
act = ld_option(ctor::toolchain::any, ctor::ld_opt::warn_all);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::ld_opt::warnings_as_errors}" };
act = ld_option(ctor::toolchain::any, ctor::ld_opt::warnings_as_errors);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::ld_opt::library_path, \"foo\"}" };
act = ld_option(ctor::toolchain::any, ctor::ld_opt::library_path, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::ld_opt::link, \"foo\"}" };
act = ld_option(ctor::toolchain::any, ctor::ld_opt::link, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::ld_opt::cpp_std, \"foo\"}" };
act = ld_option(ctor::toolchain::any, ctor::ld_opt::cpp_std, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::ld_opt::build_shared}" };
act = ld_option(ctor::toolchain::any, ctor::ld_opt::build_shared);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::ld_opt::threads}" };
act = ld_option(ctor::toolchain::any, ctor::ld_opt::threads);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::ld_opt::position_independent_code}" };
act = ld_option(ctor::toolchain::any, ctor::ld_opt::position_independent_code);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::ld_opt::position_independent_executable}" };
act = ld_option(ctor::toolchain::any, ctor::ld_opt::position_independent_executable);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "{ctor::ld_opt::custom, \"-foo\"}" };
act = ld_option(ctor::toolchain::any, ctor::ld_opt::custom, "-foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
}
void getOption_toolchain_ar_test()
@@ -683,53 +686,53 @@ public:
//
exp = { "-r" };
act = ar_option(ctor::toolchain::gcc, ctor::ar_opt::replace);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-s" };
act = ar_option(ctor::toolchain::gcc, ctor::ar_opt::add_index);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-c" };
act = ar_option(ctor::toolchain::gcc, ctor::ar_opt::create);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "foo" };
act = ar_option(ctor::toolchain::gcc, ctor::ar_opt::output, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-foo" };
act = ar_option(ctor::toolchain::gcc, ctor::ar_opt::custom, "-foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
//
// clang
//
exp = { "-r" };
act = ar_option(ctor::toolchain::clang, ctor::ar_opt::replace);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-s" };
act = ar_option(ctor::toolchain::clang, ctor::ar_opt::add_index);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-c" };
act = ar_option(ctor::toolchain::clang, ctor::ar_opt::create);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "foo" };
act = ar_option(ctor::toolchain::clang, ctor::ar_opt::output, "foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { "-foo" };
act = ar_option(ctor::toolchain::clang, ctor::ar_opt::custom, "-foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
//
// any
//
exp = { "{ctor::ar_opt::custom, \"-foo\"}" };
act = ar_option(ctor::toolchain::any, ctor::ar_opt::custom, "-foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
}
void getOption_toolchain_asm_test()
@@ -742,21 +745,21 @@ public:
//
exp = { "-foo" };
act = asm_option(ctor::toolchain::gcc, ctor::asm_opt::custom, "-foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
//
// clang
//
exp = { "-foo" };
act = asm_option(ctor::toolchain::clang, ctor::asm_opt::custom, "-foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
//
// any
//
exp = { "{ctor::asm_opt::custom, \"-foo\"}" };
act = asm_option(ctor::toolchain::any, ctor::asm_opt::custom, "-foo");
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
}
@@ -770,22 +773,22 @@ public:
//
exp = { ctor::c_opt::include_path, "foo" };
act = c_option("-Ifoo", ctor::toolchain::gcc);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { ctor::c_opt::custom, "foo" };
act = c_option("foo", ctor::toolchain::gcc);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
//
// clang
//
exp = { ctor::c_opt::include_path, "foo" };
act = c_option("-Ifoo", ctor::toolchain::clang);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { ctor::c_opt::custom, "foo" };
act = c_option("foo", ctor::toolchain::clang);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
}
void getOption_str_cxx_test()
@@ -798,22 +801,22 @@ public:
//
exp = { ctor::cxx_opt::include_path, "foo" };
act = cxx_option("-Ifoo", ctor::toolchain::gcc);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { ctor::cxx_opt::custom, "foo" };
act = cxx_option("foo", ctor::toolchain::gcc);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
//
// clang
//
exp = { ctor::cxx_opt::include_path, "foo" };
act = cxx_option("-Ifoo", ctor::toolchain::clang);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { ctor::cxx_opt::custom, "foo" };
act = cxx_option("foo", ctor::toolchain::clang);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
}
void getOption_str_ld_test()
@@ -826,22 +829,22 @@ public:
//
exp = { ctor::ld_opt::library_path, "foo" };
act = ld_option("-Lfoo", ctor::toolchain::gcc);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { ctor::ld_opt::custom, "foo" };
act = ld_option("foo", ctor::toolchain::gcc);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
//
// clang
//
exp = { ctor::ld_opt::library_path, "foo" };
act = ld_option("-Lfoo", ctor::toolchain::clang);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
exp = { ctor::ld_opt::custom, "foo" };
act = ld_option("foo", ctor::toolchain::clang);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
}
void getOption_str_ar_test()
@@ -854,14 +857,14 @@ public:
//
exp = { ctor::ar_opt::custom, "foo" };
act = ar_option("foo", ctor::toolchain::gcc);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
//
// clang
//
exp = { ctor::ar_opt::custom, "foo" };
act = ar_option("foo", ctor::toolchain::clang);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
}
void getOption_str_asm_test()
@@ -874,14 +877,14 @@ public:
//
exp = { ctor::asm_opt::custom, "foo" };
act = asm_option("foo", ctor::toolchain::gcc);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
//
// clang
//
exp = { ctor::asm_opt::custom, "foo" };
act = asm_option("foo", ctor::toolchain::clang);
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
}
@@ -893,7 +896,7 @@ public:
// Mismatching toolchain (required vs actual) results in no output
// otherwise to_strings is just a proxy for c_option
act = to_strings(ctor::toolchain::gcc, {ctor::toolchain::clang, ctor::c_opt::no_link});
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
}
void to_strings_cxx_test()
@@ -904,7 +907,7 @@ public:
// Mismatching toolchain (required vs actual) results in no output
// otherwise to_strings is just a proxy for cxx_option
act = to_strings(ctor::toolchain::gcc, {ctor::toolchain::clang, ctor::cxx_opt::no_link});
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
}
void to_strings_ld_test()
@@ -915,7 +918,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});
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
}
void to_strings_ar_test()
@@ -926,7 +929,7 @@ public:
// Mismatching toolchain (required vs actual) results in no output
// otherwise to_strings is just a proxy for ar_option
act = to_strings(ctor::toolchain::gcc, {ctor::toolchain::clang, ctor::ar_opt::custom, "foo"});
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
}
void to_strings_asm_test()
@@ -937,7 +940,7 @@ public:
// Mismatching toolchain (required vs actual) results in no output
// otherwise to_strings is just a proxy for asm_option
act = to_strings(ctor::toolchain::gcc, {ctor::toolchain::clang, ctor::asm_opt::custom, "foo"});
- uASSERT_EQUAL(exp, act);
+ assert_equal(exp, act, __FILE__, __LINE__);
}
};