persistent-cache-cpp: Fetch upstream-submitted patches
This commit is contained in:
parent
5079ef2930
commit
07130e9856
@ -1,41 +0,0 @@
|
||||
From 74265493be3a4826199329d4e6ff8fc49a33850f Mon Sep 17 00:00:00 2001
|
||||
From: Puna2608 <opna2608@protonmail.com>
|
||||
Date: Fri, 6 Oct 2023 21:06:13 +0200
|
||||
Subject: [PATCH] persistent-cache-cpp: Lenient exception test matching
|
||||
|
||||
PersistentStringCacheImpl::exceptions attempts to very precisely match a returned std::system_error exception text to an expectation.
|
||||
On LLVM's libcxx, the message returned from it doesn't match the expectation.
|
||||
|
||||
This patch changes the matching to only care about the part that doesn't depend on such an implementation detail.
|
||||
---
|
||||
.../persistent_string_cache_impl_test.cpp | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tests/core/internal/persistent_string_cache_impl/persistent_string_cache_impl_test.cpp b/tests/core/internal/persistent_string_cache_impl/persistent_string_cache_impl_test.cpp
|
||||
index f3eee59..fedd466 100644
|
||||
--- a/tests/core/internal/persistent_string_cache_impl/persistent_string_cache_impl_test.cpp
|
||||
+++ b/tests/core/internal/persistent_string_cache_impl/persistent_string_cache_impl_test.cpp
|
||||
@@ -24,6 +24,7 @@
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
|
||||
#include <gtest/gtest.h>
|
||||
+#include <gmock/gmock.h>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#include <iostream>
|
||||
@@ -1295,9 +1296,9 @@ TEST(PersistentStringCacheImpl, exceptions)
|
||||
}
|
||||
catch (system_error const& e)
|
||||
{
|
||||
- EXPECT_EQ("PersistentStringCache: check_version(): bad version: \"nan\" (cache_path: " + TEST_DB +
|
||||
- "): Unknown error 666",
|
||||
- e.what());
|
||||
+ EXPECT_THAT(
|
||||
+ e.what(),
|
||||
+ ::testing::StartsWith("PersistentStringCache: check_version(): bad version: \"nan\" (cache_path: " + TEST_DB + "): "));
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.40.1
|
||||
|
@ -1,6 +1,7 @@
|
||||
{ stdenv
|
||||
, lib
|
||||
, fetchFromGitLab
|
||||
, fetchpatch
|
||||
, gitUpdater
|
||||
, testers
|
||||
, boost
|
||||
@ -31,10 +32,38 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
|
||||
patches = [
|
||||
# Version in CMakeLists.txt didn't get bumped, emits wrong version in pkg-config
|
||||
# Remove when https://gitlab.com/ubports/development/core/lib-cpp/persistent-cache-cpp/-/merge_requests/13 merged & in release
|
||||
(fetchpatch {
|
||||
name = "0001-persistent-cache-cpp-CMakeLists-txt-Update-version.patch";
|
||||
url = "https://gitlab.com/OPNA2608/persistent-cache-cpp/-/commit/20d5d3f61563c62bcbe85e71ddc4fe16d7c995d5.patch";
|
||||
hash = "sha256-BKovtT9OvV+xEwBO8AZTxAzL9kqyDB9ip32t2Xx4eIk=";
|
||||
})
|
||||
|
||||
# PersistentStringCacheImpl.exceptions test fails on LLVM's libcxx, it depends on std::system_error producing a very specific exception text
|
||||
# Expects "Unknown error 666", gets "unspecified generic_category error"
|
||||
# https://gitlab.com/ubports/development/core/lib-cpp/persistent-cache-cpp/-/blob/1.0.5/tests/core/internal/persistent_string_cache_impl/persistent_string_cache_impl_test.cpp?ref_type=tags#L1298
|
||||
./0001-persistent-cache-cpp-Lenient-exception-test-matching.patch
|
||||
# Remove when https://gitlab.com/ubports/development/core/lib-cpp/persistent-cache-cpp/-/merge_requests/14 merged & in release
|
||||
(fetchpatch {
|
||||
name = "0002-persistent-cache-cpp-persistent_string_cache_impl_test-libcxx-fix.patch";
|
||||
url = "https://gitlab.com/OPNA2608/persistent-cache-cpp/-/commit/a696dbd3093b8333f9ee1f0cad846b2256c729c5.patch";
|
||||
hash = "sha256-SJxdXeM7W+WKEmiLTwnQYAM7YmPayEk6vPb46y4thv4=";
|
||||
})
|
||||
|
||||
# Enable usage of BUILD_TESTING to opting out of tests
|
||||
# Remove when https://gitlab.com/ubports/development/core/lib-cpp/persistent-cache-cpp/-/merge_requests/15 merged & in release
|
||||
(fetchpatch {
|
||||
name = "0003-persistent-cache-cpp-Enable-opting-out-of-tests.patch";
|
||||
url = "https://gitlab.com/OPNA2608/persistent-cache-cpp/-/commit/1fb06d28c16325e90046e93662c0f5fd16c29b4a.patch";
|
||||
hash = "sha256-2/6EYBh71S4dzqWEde+3dLOGp015fN6IifAj1bI1XAI=";
|
||||
})
|
||||
|
||||
# Enable linking based on stdenv (static or dynamic)
|
||||
# Remove when https://gitlab.com/ubports/development/core/lib-cpp/persistent-cache-cpp/-/merge_requests/16 merged & in release
|
||||
(fetchpatch {
|
||||
name = "0004-persistent-cache-cpp-Un-hardcode-static-linking.patch";
|
||||
url = "https://gitlab.com/OPNA2608/persistent-cache-cpp/-/commit/45cd84fe76e3a0e1da41a662df695009a6f4f07e.patch";
|
||||
hash = "sha256-1UjdhzrjnIUO1ySaZTm0vkdNgok0RNlGtNOWUoAUlzU=";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
@ -45,11 +74,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
# Runs in parallel to other tests, limit to 1 thread
|
||||
substituteInPlace tests/headers/compile_headers.py \
|
||||
--replace 'multiprocessing.cpu_count()' '1'
|
||||
'' + (if finalAttrs.finalPackage.doCheck then ''
|
||||
'' + lib.optionalString finalAttrs.finalPackage.doCheck ''
|
||||
patchShebangs tests/{headers,whitespace}/*.py
|
||||
'' else ''
|
||||
sed -i -e '/add_subdirectory(tests)/d' CMakeLists.txt
|
||||
'');
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
@ -76,7 +103,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
cmakeFlags = [
|
||||
# error: 'old_version' may be used uninitialized
|
||||
"-DWerror=OFF"
|
||||
(lib.cmakeBool "Werror" false)
|
||||
(lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
|
||||
];
|
||||
|
||||
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||
|
Loading…
Reference in New Issue
Block a user