summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ctor.cc52
-rw-r--r--test/execute_test.cc8
-rw-r--r--test/source_type_test.cc8
-rwxr-xr-xtest/suite/test.sh2
-rw-r--r--test/tasks_test.cc76
-rw-r--r--test/testprog.cc33
-rw-r--r--test/tmpfile.h28
-rw-r--r--test/tools_test.cc315
8 files changed, 300 insertions, 222 deletions
diff --git a/test/ctor.cc b/test/ctor.cc
index ccf1c31..66159b5 100644
--- a/test/ctor.cc
+++ b/test/ctor.cc
@@ -10,15 +10,18 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
return
{
{
+ .name = "testprog",
.type = ctor::target_type::unit_test,
.system = ctor::output_system::build,
.target = "testprog",
.sources = {
- "testprog.cc",
+ {"testprog.cc"},
},
.flags = {
.cxxflags = {
- "-std=c++20", "-O3", "-Wall", "-Werror",
+ "-std=c++20", "-O3", "-Wall",// "-Werror",
+ {ctor::toolchain::msvc, ctor::cxx_opt::custom, "/EHsc"},
+ {ctor::toolchain::msvc, ctor::cxx_opt::custom, "/D_CRT_SECURE_NO_WARNINGS"},
},
},
},
@@ -35,9 +38,11 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
.depends = { "testprog", },
.flags = {
.cxxflags = {
- "-std=c++20", "-O3", "-Wall", "-Werror",
+ "-std=c++20", "-O3", "-Wall",// "-Werror",
"-I../src", "-Iuunit",
"-DOUTPUT=\"execute\"",
+ {ctor::toolchain::msvc, ctor::cxx_opt::custom, "/EHsc"},
+ {ctor::toolchain::msvc, ctor::cxx_opt::custom, "/D_CRT_SECURE_NO_WARNINGS"},
},
.ldflags = { "-pthread" },
},
@@ -50,12 +55,14 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"tasks_test.cc",
"testmain.cc",
},
- .depends = { "libctor_nomain.a" },
+ .depends = { "libctor_nomain.lib" },
.flags = {
.cxxflags = {
- "-std=c++20", "-O3", "-Wall", "-Werror",
+ "-std=c++20", "-O3", "-Wall",// "-Werror",
"-I../src", "-Iuunit",
"-DOUTPUT=\"tasks\"",
+ {ctor::toolchain::msvc, ctor::cxx_opt::custom, "/EHsc"},
+ {ctor::toolchain::msvc, ctor::cxx_opt::custom, "/D_CRT_SECURE_NO_WARNINGS"},
},
.ldflags = { "-pthread" },
},
@@ -68,12 +75,14 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"source_type_test.cc",
"testmain.cc",
},
- .depends = { "libctor_nomain.a" },
+ .depends = { "libctor_nomain.lib" },
.flags = {
.cxxflags = {
- "-std=c++20", "-O3", "-Wall", "-Werror",
+ "-std=c++20", "-O3", "-Wall",// "-Werror",
"-I../src", "-Iuunit",
"-DOUTPUT=\"source_type\"",
+ {ctor::toolchain::msvc, ctor::cxx_opt::custom, "/EHsc"},
+ {ctor::toolchain::msvc, ctor::cxx_opt::custom, "/D_CRT_SECURE_NO_WARNINGS"},
},
.ldflags = { "-pthread" },
},
@@ -91,16 +100,18 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
//.depends = { "libctor_nomain.a" },
.flags = {
.cxxflags = {
- "-std=c++20", "-O3", "-Wall", "-Werror",
+ "-std=c++20", "-O3", "-Wall",// "-Werror",
"-I../src", "-Iuunit",
"-DOUTPUT=\"tools\"",
+ {ctor::toolchain::msvc, ctor::cxx_opt::custom, "/EHsc"},
+ {ctor::toolchain::msvc, ctor::cxx_opt::custom, "/D_CRT_SECURE_NO_WARNINGS"},
},
},
},
{
.type = ctor::target_type::unit_test_library,
.system = ctor::output_system::build,
- .target = "libctor_nomain.a",
+ .target = "libctor_nomain.lib",
.sources = {
"../src/build.cc",
"../src/configure.cc",
@@ -116,11 +127,32 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"../src/tools.cc",
"../src/util.cc",
"../src/externals_manual.cc",
+ {ctor::toolchain::msvc, "../getopt-for-windows/getopt.c"},
},
.flags = {
+ .cflags = {
+ "-O3",
+// "-g",
+// "-Wall",
+// "-Wconversion",
+// "-Wextra",
+ //"-Werror",
+ "-I../src",
+ {ctor::toolchain::msvc, ctor::c_opt::custom, "/I../getopt-for-windows"},
+ {ctor::toolchain::msvc, ctor::c_opt::custom, "/D_X86_"},
+ {ctor::toolchain::msvc, ctor::c_opt::custom, "/EHsc"},
+ {ctor::toolchain::msvc, ctor::c_opt::custom, "/external:W0"},
+ {ctor::toolchain::msvc, ctor::c_opt::custom, "/D_CRT_SECURE_NO_WARNINGS"},
+ },
.cxxflags = {
- "-std=c++20", "-O3", "-Wall", "-Werror",
+ "-std=c++20", "-O3", "-Wall",// "-Werror",
"-I../src",
+ {ctor::toolchain::msvc, ctor::cxx_opt::custom, "/Igetopt-for-windows"},
+ {ctor::toolchain::msvc, ctor::cxx_opt::custom, "/D_X86_"},
+ {ctor::toolchain::msvc, ctor::cxx_opt::custom, "/EHsc"},
+ {ctor::toolchain::msvc, ctor::cxx_opt::custom, "/external:W0"},
+ {ctor::toolchain::msvc, ctor::cxx_opt::custom, "/D_CRT_SECURE_NO_WARNINGS"},
+ {ctor::toolchain::msvc, ctor::cxx_opt::custom, "/Dstrdup=_strdup"},
},
.ldflags = { "-pthread" },
},
diff --git a/test/execute_test.cc b/test/execute_test.cc
index 4c686bf..027ef3b 100644
--- a/test/execute_test.cc
+++ b/test/execute_test.cc
@@ -30,11 +30,11 @@ public:
uASSERT(!cmd.empty());
auto value = execute(s, cmd, {"retval", "0"}, {}, false);
- uASSERT_EQUAL(0, value);
+ assert_equal(0, value, __FILE__, __LINE__);
value = execute(s, cmd, {"retval", "1"}, {}, false);
- uASSERT_EQUAL(1, value);
+ assert_equal(1, value, __FILE__, __LINE__);
value = execute(s, "no-such-binary", {}, {}, false);
- uASSERT_EQUAL(1, value);
+ assert_equal(1, value, __FILE__, __LINE__);
}
void env()
@@ -59,7 +59,7 @@ public:
env["LANG"] = "foo";
auto value = execute(s, cmd, {"envdump", tmp.get()}, env, false);
- uASSERT_EQUAL(0, value);
+ assert_equal(0, value, __FILE__, __LINE__);
std::vector<std::string> vars;
{
diff --git a/test/source_type_test.cc b/test/source_type_test.cc
index 288f1e5..ced8e3a 100644
--- a/test/source_type_test.cc
+++ b/test/source_type_test.cc
@@ -53,22 +53,22 @@ public:
{
{ // c++
TestableTaskCC task("hello.cc");
- uASSERT_EQUAL(ctor::language::cpp, task.language());
+ assert_equal(ctor::language::cpp, task.language(), __FILE__, __LINE__);
}
{ // c
TestableTaskCC task("hello.c");
- uASSERT_EQUAL(ctor::language::c, task.language());
+ assert_equal(ctor::language::c, task.language(), __FILE__, __LINE__);
}
{ // asm
TestableTaskCC task("hello.s");
- uASSERT_EQUAL(ctor::language::assembler, task.language());
+ assert_equal(ctor::language::assembler, task.language(), __FILE__, __LINE__);
}
{ // custom/explicit language
TestableTaskCC task( {"hello.foo", ctor::language::assembler} );
- uASSERT_EQUAL(ctor::language::assembler, task.language());
+ assert_equal(ctor::language::assembler, task.language(), __FILE__, __LINE__);
}
// Note: Failure state will result in exit(1) so cannot be tested
diff --git a/test/suite/test.sh b/test/suite/test.sh
index c112351..23740a9 100755
--- a/test/suite/test.sh
+++ b/test/suite/test.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+#set -x
+
: ${CXX:=g++}
: ${CTORDIR:=../../build}
: ${BUILDDIR:=build}
diff --git a/test/tasks_test.cc b/test/tasks_test.cc
index 3de6982..c6909c0 100644
--- a/test/tasks_test.cc
+++ b/test/tasks_test.cc
@@ -93,17 +93,17 @@ public:
using namespace std::string_literals;
ctor::settings settings{};
const auto& targets = getTargets(settings);
- uASSERT_EQUAL(4u, targets.size());
+ assert_equal(4u, targets.size(), __FILE__, __LINE__);
- uASSERT_EQUAL("target1"s, targets[0].config.target);
- uASSERT_EQUAL("target2"s, targets[1].config.target);
- uASSERT_EQUAL("target3"s, targets[2].config.target);
- uASSERT_EQUAL("target4"s, targets[3].config.target);
+ assert_equal("target1"s, targets[0].config.target, __FILE__, __LINE__);
+ assert_equal("target2"s, targets[1].config.target, __FILE__, __LINE__);
+ assert_equal("target3"s, targets[2].config.target, __FILE__, __LINE__);
+ assert_equal("target4"s, targets[3].config.target, __FILE__, __LINE__);
- uASSERT_EQUAL("test"s, targets[0].path);
- uASSERT_EQUAL("test"s, targets[1].path);
- uASSERT_EQUAL("test"s, targets[2].path);
- uASSERT_EQUAL("test"s, targets[3].path);
+ assert_equal("test"s, targets[0].path, __FILE__, __LINE__);
+ assert_equal("test"s, targets[1].path, __FILE__, __LINE__);
+ assert_equal("test"s, targets[2].path, __FILE__, __LINE__);
+ assert_equal("test"s, targets[3].path, __FILE__, __LINE__);
}
void getTasks_test()
@@ -112,26 +112,26 @@ public:
ctor::settings settings{ .builddir = "foo" };
{
auto tasks = getTasks(settings);
- uASSERT_EQUAL(6u, tasks.size());
+ assert_equal(6u, tasks.size(), __FILE__, __LINE__);
// Note: count() is used here because the order doesn't matter
- uASSERT_EQUAL(1u, count(tasks, "target1"s));
- uASSERT_EQUAL(1u, count(tasks, "target2"s));
- uASSERT_EQUAL(1u, count(tasks, "target3"s));
- uASSERT_EQUAL(1u, count(tasks, "target4"s));
- uASSERT_EQUAL(1u, count(tasks, "test/target1-foo_cc.o"s));
- uASSERT_EQUAL(1u, count(tasks, "test/target1-bar_c.o"s));
+ assert_equal(1u, count(tasks, "target1"s), __FILE__, __LINE__);
+ assert_equal(1u, count(tasks, "target2"s), __FILE__, __LINE__);
+ assert_equal(1u, count(tasks, "target3"s), __FILE__, __LINE__);
+ assert_equal(1u, count(tasks, "target4"s), __FILE__, __LINE__);
+ assert_equal(1u, count(tasks, "test/target1-foo_cc.o"s), __FILE__, __LINE__);
+ assert_equal(1u, count(tasks, "test/target1-bar_c.o"s), __FILE__, __LINE__);
}
{
auto tasks = getTasks(settings, {"target1", "target3"});
- uASSERT_EQUAL(4u, tasks.size());
- uASSERT_EQUAL(1u, count(tasks, "target1"s));
- uASSERT_EQUAL(1u, count(tasks, "target3"s));
- uASSERT_EQUAL(1u, count(tasks, "test/target1-foo_cc.o"s));
- uASSERT_EQUAL(1u, count(tasks, "test/target1-bar_c.o"s));
+ assert_equal(4u, tasks.size(), __FILE__, __LINE__);
+ assert_equal(1u, count(tasks, "target1"s), __FILE__, __LINE__);
+ assert_equal(1u, count(tasks, "target3"s), __FILE__, __LINE__);
+ assert_equal(1u, count(tasks, "test/target1-foo_cc.o"s), __FILE__, __LINE__);
+ assert_equal(1u, count(tasks, "test/target1-bar_c.o"s), __FILE__, __LINE__);
}
{
auto tasks = getTasks(settings, {"no-such-target"});
- uASSERT_EQUAL(0u, tasks.size());
+ assert_equal(0u, tasks.size(), __FILE__, __LINE__);
}
}
@@ -146,10 +146,10 @@ public:
for(auto& task : dirtyTasks)
{
- uASSERT_EQUAL(0, task->registerDepTasks(allTasks));
+ assert_equal(0, task->registerDepTasks(allTasks), __FILE__, __LINE__);
}
- uASSERT_EQUAL(nullptr, getNextTask(allTasks, dirtyTasks));
+ assert_equal(nullptr, getNextTask(allTasks, dirtyTasks), __FILE__, __LINE__);
}
{ // Zero (One task, no dirty)
@@ -162,10 +162,10 @@ public:
for(auto& task : dirtyTasks)
{
- uASSERT_EQUAL(0, task->registerDepTasks(allTasks));
+ assert_equal(0, task->registerDepTasks(allTasks), __FILE__, __LINE__);
}
- uASSERT_EQUAL(nullptr, getNextTask(allTasks, dirtyTasks));
+ assert_equal(nullptr, getNextTask(allTasks, dirtyTasks), __FILE__, __LINE__);
}
{ // One (One task, one dirty)
@@ -179,11 +179,11 @@ public:
for(auto& task : dirtyTasks)
{
- uASSERT_EQUAL(0, task->registerDepTasks(allTasks));
+ assert_equal(0, task->registerDepTasks(allTasks), __FILE__, __LINE__);
}
- uASSERT_EQUAL(task1, getNextTask(allTasks, dirtyTasks));
- uASSERT_EQUAL(0u, dirtyTasks.size());
+ assert_equal(task1, getNextTask(allTasks, dirtyTasks), __FILE__, __LINE__);
+ assert_equal(0u, dirtyTasks.size(), __FILE__, __LINE__);
}
{ // One (Two tasks, one dirty)
@@ -199,11 +199,11 @@ public:
for(auto& task : dirtyTasks)
{
- uASSERT_EQUAL(0, task->registerDepTasks(allTasks));
+ assert_equal(0, task->registerDepTasks(allTasks), __FILE__, __LINE__);
}
- uASSERT_EQUAL(task2, getNextTask(allTasks, dirtyTasks));
- uASSERT_EQUAL(0u, dirtyTasks.size());
+ assert_equal(task2, getNextTask(allTasks, dirtyTasks), __FILE__, __LINE__);
+ assert_equal(0u, dirtyTasks.size(), __FILE__, __LINE__);
}
{ // One (Two tasks, one dirty which depends on the other)
@@ -221,11 +221,11 @@ public:
for(auto& task : dirtyTasks)
{
- uASSERT_EQUAL(0, task->registerDepTasks(allTasks));
+ assert_equal(0, task->registerDepTasks(allTasks), __FILE__, __LINE__);
}
- uASSERT_EQUAL(task2, getNextTask(allTasks, dirtyTasks));
- uASSERT_EQUAL(0u, dirtyTasks.size());
+ assert_equal(task2, getNextTask(allTasks, dirtyTasks), __FILE__, __LINE__);
+ assert_equal(0u, dirtyTasks.size(), __FILE__, __LINE__);
}
{ // One (Two tasks, Both dirty, one depends on the other)
@@ -244,11 +244,11 @@ public:
for(auto& task : dirtyTasks)
{
- uASSERT_EQUAL(0, task->registerDepTasks(allTasks));
+ assert_equal(0, task->registerDepTasks(allTasks), __FILE__, __LINE__);
}
- uASSERT_EQUAL(task1, getNextTask(allTasks, dirtyTasks));
- uASSERT_EQUAL(1u, dirtyTasks.size());
+ assert_equal(task1, getNextTask(allTasks, dirtyTasks), __FILE__, __LINE__);
+ assert_equal(1u, dirtyTasks.size(), __FILE__, __LINE__);
}
}
diff --git a/test/testprog.cc b/test/testprog.cc
index dbfb665..c135061 100644
--- a/test/testprog.cc
+++ b/test/testprog.cc
@@ -2,7 +2,13 @@
#include <fstream>
#include <string>
-extern const char **environ; // see 'man environ'
+#if defined(_WIN32)
+#define WINDOWS_LEAN_AND_MEAN
+#include <windows.h>
+#undef max
+#else
+extern char **environ; // see 'man environ'
+#endif
int main(int argc, const char* argv[])
{
@@ -20,10 +26,35 @@ int main(int argc, const char* argv[])
return 0;
}
std::ofstream ostrm(argv[2], std::ios::binary);
+#if defined(_WIN32)
+ auto env_strings = GetEnvironmentStrings();
+ const char* ptr = env_strings;
+ std::string env;
+ while(true)
+ {
+ if(*ptr == '\0')
+ {
+ if(env.empty())
+ {
+ // no more
+ break;
+ }
+ ostrm << env << "\n";
+ env.clear();
+ ++ptr;
+ continue;
+ }
+
+ env += *ptr;
+ ++ptr;
+ }
+ FreeEnvironmentStrings(env_strings);
+#else
for(auto current = environ; *current; ++current)
{
ostrm << (*current) << "\n";
}
+#endif
}
if(cmd == "retval")
diff --git a/test/tmpfile.h b/test/tmpfile.h
index 5d114d0..07d7a4a 100644
--- a/test/tmpfile.h
+++ b/test/tmpfile.h
@@ -4,7 +4,6 @@
#pragma once
#include <cstdlib>
-#include <unistd.h>
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
@@ -12,6 +11,9 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <io.h>
+#else
+#include <unistd.h>
#endif
struct tmp_file
@@ -19,23 +21,31 @@ struct tmp_file
tmp_file(const std::string& data = {})
{
int fd;
+ auto tmp_dir = std::filesystem::temp_directory_path();
+ auto tmp_file_template = tmp_dir / "ctor_tmp_file-XXXXXX";
+ filename = tmp_file_template.string();
#ifdef _WIN32
- char templ[] = "ctor_tmp_file-XXXXXX"; // buffer for filename
- _mktemp_s(templ, sizeof(templ));
- fd = open(templ, O_CREAT | O_RDWR);
+ _mktemp_s(filename.data(), filename.size());
+ fd = _open(filename.data(), O_CREAT | O_RDWR);
+ auto sz = _write(fd, data.data(), data.size());
+ (void)sz;
+ _close(fd);
#else
- char templ[] = "/tmp/ctor_tmp_file-XXXXXX"; // buffer for filename
- fd = mkstemp(templ);
-#endif
- filename = templ;
+ fd = mkstemp(filename.data());
auto sz = write(fd, data.data(), data.size());
(void)sz;
close(fd);
- }
+#endif
+ std::cout << "Temporary file: " << filename << "\n";
+}
~tmp_file()
{
+#ifdef _WIN32
+ _unlink(filename.data());
+#else
unlink(filename.data());
+#endif
}
const std::string& get() const
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__);
}
};