diff options
| author | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-12-28 21:48:09 +0100 |
|---|---|---|
| committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2026-01-06 17:06:18 +0100 |
| commit | 738ea8dc05aef2d354680068715eb88d96351cf3 (patch) | |
| tree | 6062368b04c55d2a958f28964d38c403d680cf48 /test/generated_sources_test.cc | |
| parent | fa99825fa800f0faf4a6e6b1d639b261c7aa43c9 (diff) | |
WIPmsvc-gene
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; } } |
