From 0a4f1db580a083e72738d3fffff669f36ffc6b7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Tassoux?= Date: Fri, 2 Sep 2022 19:41:49 +0200 Subject: [PATCH] [catch2] Update to 3.1.0 (#25874) * [catch2] Update to 3.1.0 * [catch2] Update version files * [catch2] Fix dll intallation paths * [catch2] Update version files * [catch2] Fix UWP build failure * [catch2] Update version files --- ports/catch2/fix-install-path.patch | 17 +++++++++++---- ports/catch2/fix-uwp-build.patch | 34 +++++++++++++++++++++++++++++ ports/catch2/portfile.cmake | 5 +++-- ports/catch2/vcpkg.json | 3 +-- versions/baseline.json | 4 ++-- versions/c-/catch2.json | 5 +++++ 6 files changed, 58 insertions(+), 10 deletions(-) create mode 100644 ports/catch2/fix-uwp-build.patch diff --git a/ports/catch2/fix-install-path.patch b/ports/catch2/fix-install-path.patch index fc90c57cc6..5813ffe81c 100644 --- a/ports/catch2/fix-install-path.patch +++ b/ports/catch2/fix-install-path.patch @@ -1,7 +1,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -168,7 +168,7 @@ +@@ -170,7 +170,7 @@ ## Provide some pkg-config integration set(PKGCONFIG_INSTALL_DIR @@ -13,15 +13,20 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -335,12 +335,20 @@ +@@ -356,12 +356,28 @@ install( TARGETS Catch2 - Catch2WithMain EXPORT Catch2Targets - DESTINATION +- DESTINATION ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ++ ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ++ ${CMAKE_INSTALL_BINDIR} ) + + install( @@ -29,8 +34,12 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt + Catch2WithMain + EXPORT + Catch2Targets -+ DESTINATION ++ LIBRARY DESTINATION + ${CMAKE_INSTALL_LIBDIR}/manual-link ++ ARCHIVE DESTINATION ++ ${CMAKE_INSTALL_LIBDIR}/manual-link ++ RUNTIME DESTINATION ++ ${CMAKE_INSTALL_BINDIR} + ) diff --git a/ports/catch2/fix-uwp-build.patch b/ports/catch2/fix-uwp-build.patch new file mode 100644 index 0000000000..feee34cfba --- /dev/null +++ b/ports/catch2/fix-uwp-build.patch @@ -0,0 +1,34 @@ +diff --git a/src/catch2/catch_config.cpp b/src/catch2/catch_config.cpp +index 4465831d..7555a21f 100644 +--- a/src/catch2/catch_config.cpp ++++ b/src/catch2/catch_config.cpp +@@ -26,7 +26,12 @@ namespace { + # pragma warning( disable : 4996 ) + # endif + ++# if defined( WINAPI_FAMILY ) ++ // UWP doesn't support environment variables. ++ return false; ++# else + return std::getenv( "BAZEL_TEST" ) != nullptr; ++# endif + + # if defined( _MSC_VER ) + # pragma warning( pop ) +@@ -81,6 +86,8 @@ namespace Catch { + } ); + } + ++#if !defined( WINAPI_FAMILY ) ++ // UWP doesn't support environment variables. + if(provideBazelReporterOutput()){ + // Register a JUnit reporter for Bazel. Bazel sets an environment + // variable with the path to XML output. If this file is written to +@@ -102,6 +109,7 @@ namespace Catch { + { "junit", std::string( bazelOutputFilePtr ), {}, {} } ); + } + } ++#endif + + + // We now fixup the reporter specs to handle default output spec, diff --git a/ports/catch2/portfile.cmake b/ports/catch2/portfile.cmake index 300e5dca68..3cccd9e2d6 100644 --- a/ports/catch2/portfile.cmake +++ b/ports/catch2/portfile.cmake @@ -1,11 +1,12 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO catchorg/Catch2 - REF v3.0.1 - SHA512 065094c19cdf98b40f96a390e887542f895495562a91cdc28d68ce03690866d846ec87d320405312a2b97eacaa5351d3e55f0012bb9de40073c8d4444d82b0a1 + REF v3.1.0 + SHA512 49e5339263190a6ef15284ef2dcc9e727ce0659cb750d4078024ccf6c6f339740a3a662273718ea73adfbc5928c3ef7268175ebda5ee9ec97ca58fed98747b44 HEAD_REF devel PATCHES fix-install-path.patch + fix-uwp-build.patch ) vcpkg_cmake_configure( diff --git a/ports/catch2/vcpkg.json b/ports/catch2/vcpkg.json index afeed72f58..d714616b26 100644 --- a/ports/catch2/vcpkg.json +++ b/ports/catch2/vcpkg.json @@ -1,7 +1,6 @@ { "name": "catch2", - "version-semver": "3.0.1", - "port-version": 2, + "version-semver": "3.1.0", "description": "A modern, header-only test framework for unit testing.", "homepage": "https://github.com/catchorg/Catch2", "license": "BSL-1.0", diff --git a/versions/baseline.json b/versions/baseline.json index 5d1d43e236..e9290e2dfe 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1297,8 +1297,8 @@ "port-version": 1 }, "catch2": { - "baseline": "3.0.1", - "port-version": 2 + "baseline": "3.1.0", + "port-version": 0 }, "cccapstone": { "baseline": "9b4128ee1153e78288a1b5433e2c06a0d47a4c4e", diff --git a/versions/c-/catch2.json b/versions/c-/catch2.json index 4cfa4561a2..2128ee1aaf 100644 --- a/versions/c-/catch2.json +++ b/versions/c-/catch2.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "414a5ef901a6f05c85b4f19ff2d0d216933a65b1", + "version-semver": "3.1.0", + "port-version": 0 + }, { "git-tree": "1c528318ebe10c945563bf9942c8b2141253bf87", "version-semver": "3.0.1",