diff --git a/.github/workflows/qt-ci.yml b/.github/workflows/qt-ci.yml index dd504d9ab..dbda023e0 100644 --- a/.github/workflows/qt-ci.yml +++ b/.github/workflows/qt-ci.yml @@ -82,7 +82,7 @@ jobs: build_type: RelWithDebInfo qt_version: 5.15.2 qt_target: desktop - deployment_target: 10.13 + deployment_target: 10.15 deployment_arch: "x86_64" compiler: "" - name: macOS diff --git a/platform/ios/test/core/BUILD.bazel b/platform/ios/test/core/BUILD.bazel index cfa0ef787..9e29a5ae1 100644 --- a/platform/ios/test/core/BUILD.bazel +++ b/platform/ios/test/core/BUILD.bazel @@ -49,7 +49,7 @@ ios_application( infoplists = [ "Info.plist", ], - minimum_os_version = "12.0", + minimum_os_version = "13.0", provisioning_profile = "//platform/ios:xcode_profile", deps = [ "//platform/ios/test/common:test_app_srcs", @@ -58,7 +58,7 @@ ios_application( ios_unit_test( name = "CppUnitTests", - minimum_os_version = "12.0", + minimum_os_version = "13.0", provisioning_profile = "//platform/ios:xcode_profile", test_host = "CppUnitTestsApp", visibility = ["@rules_xcodeproj//xcodeproj:generated"], diff --git a/test/style/expression/expression.test.cpp b/test/style/expression/expression.test.cpp index c24559fa5..8490d34b7 100644 --- a/test/style/expression/expression.test.cpp +++ b/test/style/expression/expression.test.cpp @@ -5,21 +5,11 @@ #include #include #include - #include - #include +#include #include -#if defined(_MSC_VER) && !defined(__clang__) -#include -#ifdef GetObject -#undef GetObject -#endif -#else -#include -#endif - using namespace mbgl; using namespace mbgl::style; @@ -88,51 +78,27 @@ TEST_P(ExpressionEqualityTest, ExpressionEquality) { EXPECT_FALSE(*expression_b == *((expression_b->getKind() == Kind::Literal) ? dsl::id() : dsl::literal(0.0))); } -static void populateNames(std::vector& names) { - const std::string ending = ".a.json"; +static std::vector populateNames() { + std::vector test_inputs; - std::string style_directory = "test/fixtures/expression_equality"; + const std::string ending{".a.json"}; - auto testName = [&](const std::string& name) { - if (name.length() >= ending.length() && - name.compare(name.length() - ending.length(), ending.length(), ending) == 0) { - names.push_back(name.substr(0, name.length() - ending.length())); - } - }; + const std::filesystem::path style_directory{"test/fixtures/expression_equality"}; -#if defined(_MSC_VER) && !defined(__clang__) - style_directory += "/*"; - WIN32_FIND_DATAA ffd; - HANDLE hFind = FindFirstFileA(style_directory.c_str(), &ffd); - if (hFind != INVALID_HANDLE_VALUE) { - do { - const std::string name = ffd.cFileName; - testName(name); - } while (FindNextFileA(hFind, &ffd) != 0); - FindClose(hFind); - } -#else - DIR* dir = opendir(style_directory.c_str()); - if (dir != nullptr) { - for (dirent* dp = nullptr; (dp = readdir(dir)) != nullptr;) { - const std::string name = dp->d_name; + for (const auto& file_entry : std::filesystem::directory_iterator(style_directory)) { + auto file_entry_path = file_entry.path().string(); + if (!file_entry.path().empty() && file_entry_path.length() >= ending.length() && + file_entry_path.compare(file_entry_path.length() - ending.length(), ending.length(), ending) == 0) { #if ANDROID - // Android unit test uses number-format stub implementation so skip the tests - if (name.find("number-format") != std::string::npos) { + if (file_entry_path.find("number-format") != std::string::npos) { continue; } #endif - testName(name); + auto file_name = file_entry.path().filename().string(); + test_inputs.push_back(file_name.substr(0, file_name.length() - ending.length())); } - closedir(dir); } -#endif + return test_inputs; } -INSTANTIATE_TEST_SUITE_P(Expression, ExpressionEqualityTest, ::testing::ValuesIn([] { - std::vector names; - populateNames(names); - std::sort(names.begin(), names.end()); - EXPECT_GT(names.size(), 0u); - return names; - }())); +INSTANTIATE_TEST_SUITE_P(Expression, ExpressionEqualityTest, ::testing::ValuesIn(populateNames()));