diff options
Diffstat (limited to 'test/generated_sources_test.cc')
| -rw-r--r-- | test/generated_sources_test.cc | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/test/generated_sources_test.cc b/test/generated_sources_test.cc index 8c46983..c3fbd41 100644 --- a/test/generated_sources_test.cc +++ b/test/generated_sources_test.cc @@ -17,10 +17,26 @@ public: uTEST(GeneratedSourcesTest::test_many_to_one_output); } + std::string ext; + void setup() { // Make sure we start from a clean slate getConfigFileList().clear(); + + const auto& c = ctor::get_configuration(); + switch(c.build_arch) + { + case ctor::arch::unix: + case ctor::arch::apple: + ext = ""; + break; + case ctor::arch::windows: + ext = ".exe"; + break; + case ctor::arch::unknown: + break; + } } void test_custom_output() @@ -38,7 +54,7 @@ public: } }, { - .target = "this_is_unused", + .target = "this_is_unused_", .sources = { {"bar.x", ctor::output_file{"foo.cc"}}, {"bar.y", ctor::output_file{"bar.cc"}}, @@ -63,13 +79,14 @@ public: bool found{false}; for(const auto& task : tasks) { - if(task->target() == "test1") + if(task->target() == "test1"+ext) { auto deps_test1 = task->getDependsTasks(); uASSERT_EQUAL(1u, deps_test1.size()); auto deps_foo_o = deps_test1[0]->getDependsTasks(); uASSERT_EQUAL(1u, deps_foo_o.size()); - uASSERT_EQUAL("test/bar.x"s, deps_foo_o[0]->source()); + uASSERT_EQUAL(std::filesystem::path("test/bar.x"), + std::filesystem::path(deps_foo_o[0]->source())); found = true; } } @@ -96,10 +113,10 @@ public: {"bar.x"}, {"bar.y"}, }, - .function = [](const std::vector<std::string>& input, - const std::string& output, - const ctor::build_configuration& config, - const ctor::settings& settings) + .function = []([[maybe_unused]]const std::vector<std::string>& input, + [[maybe_unused]]const std::string& output, + [[maybe_unused]]const ctor::build_configuration& config, + [[maybe_unused]]const ctor::settings& settings) { return 0; } @@ -116,13 +133,14 @@ public: bool found{false}; for(const auto& task : tasks) { - if(task->target() == "test1") + if(task->target() == "test1"+ext) { auto deps_test1 = task->getDependsTasks(); uASSERT_EQUAL(1u, deps_test1.size()); auto deps_foo_o = deps_test1[0]->getDependsTasks(); uASSERT_EQUAL(1u, deps_foo_o.size()); - uASSERT_EQUAL("test/bar.x"s, deps_foo_o[0]->source()); + uASSERT_EQUAL(std::filesystem::path("test/bar.x"), + std::filesystem::path(deps_foo_o[0]->source())); found = true; } } |
