From 321f25af1ba33d8409cd294b4f50d0d3e79cf3bd Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 14 Jan 2023 12:05:23 +0100 Subject: Add ar_flag support for ar tool, replacing hardcoded values. --- test/tools_test.cc | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/tools_test.cc b/test/tools_test.cc index 1d377b7..7127b8d 100644 --- a/test/tools_test.cc +++ b/test/tools_test.cc @@ -666,22 +666,54 @@ public: // // gcc // + exp = { "-r" }; + act = ar_option(ctor::toolchain::gcc, ctor::ar_opt::replace); + uASSERT_EQUAL(exp, act); + + exp = { "-s" }; + act = ar_option(ctor::toolchain::gcc, ctor::ar_opt::add_index); + uASSERT_EQUAL(exp, act); + + exp = { "-c" }; + act = ar_option(ctor::toolchain::gcc, ctor::ar_opt::create); + uASSERT_EQUAL(exp, act); + + exp = { "foo" }; + act = ar_option(ctor::toolchain::gcc, ctor::ar_opt::output, "foo"); + uASSERT_EQUAL(exp, act); + exp = { "-foo" }; - act = asm_option(ctor::toolchain::gcc, ctor::asm_opt::custom, "-foo"); + act = ar_option(ctor::toolchain::gcc, ctor::ar_opt::custom, "-foo"); uASSERT_EQUAL(exp, act); // // clang // + exp = { "-r" }; + act = ar_option(ctor::toolchain::clang, ctor::ar_opt::replace); + uASSERT_EQUAL(exp, act); + + exp = { "-s" }; + act = ar_option(ctor::toolchain::clang, ctor::ar_opt::add_index); + uASSERT_EQUAL(exp, act); + + exp = { "-c" }; + act = ar_option(ctor::toolchain::clang, ctor::ar_opt::create); + uASSERT_EQUAL(exp, act); + + exp = { "foo" }; + act = ar_option(ctor::toolchain::clang, ctor::ar_opt::output, "foo"); + uASSERT_EQUAL(exp, act); + exp = { "-foo" }; - act = asm_option(ctor::toolchain::clang, ctor::asm_opt::custom, "-foo"); + act = ar_option(ctor::toolchain::clang, ctor::ar_opt::custom, "-foo"); uASSERT_EQUAL(exp, act); // // any // - exp = { "{ctor::asm_opt::custom, \"-foo\"}" }; - act = asm_option(ctor::toolchain::any, ctor::asm_opt::custom, "-foo"); + exp = { "{ctor::ar_opt::custom, \"-foo\"}" }; + act = ar_option(ctor::toolchain::any, ctor::ar_opt::custom, "-foo"); uASSERT_EQUAL(exp, act); } -- cgit v1.2.3