From 578bb68e7e552d72911235e5bf8b5e3b97222ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=AErekc=C3=A4H=20nitraM=E2=80=AE?= Date: Sun, 16 Mar 2025 11:28:08 +0100 Subject: [PATCH] poco: seperately disable broken tests on linux and darwin poco: Better optionals --- ...atch => disable-broken-tests-darwin.patch} | 0 .../po/poco/disable-broken-tests-linux.patch | 28 +++++++++++++++ pkgs/by-name/po/poco/package.nix | 34 ++++++++++++------- 3 files changed, 49 insertions(+), 13 deletions(-) rename pkgs/by-name/po/poco/{disable-broken-tests.patch => disable-broken-tests-darwin.patch} (100%) create mode 100644 pkgs/by-name/po/poco/disable-broken-tests-linux.patch diff --git a/pkgs/by-name/po/poco/disable-broken-tests.patch b/pkgs/by-name/po/poco/disable-broken-tests-darwin.patch similarity index 100% rename from pkgs/by-name/po/poco/disable-broken-tests.patch rename to pkgs/by-name/po/poco/disable-broken-tests-darwin.patch diff --git a/pkgs/by-name/po/poco/disable-broken-tests-linux.patch b/pkgs/by-name/po/poco/disable-broken-tests-linux.patch new file mode 100644 index 000000000000..8f976a30a0b1 --- /dev/null +++ b/pkgs/by-name/po/poco/disable-broken-tests-linux.patch @@ -0,0 +1,28 @@ +diff --git a/Data/testsuite/src/DataTest.cpp b/Data/testsuite/src/DataTest.cpp +index a78c4e5..e8d9335 100644 +--- a/Data/testsuite/src/DataTest.cpp ++++ b/Data/testsuite/src/DataTest.cpp +@@ -1652 +1652 @@ CppUnit::Test* DataTest::suite() +- CppUnit_addTest(pSuite, DataTest, testSQLChannel); ++ // CppUnit_addTest(pSuite, DataTest, testSQLChannel); +diff --git a/Net/testsuite/src/DatagramSocketTest.cpp b/Net/testsuite/src/DatagramSocketTest.cpp +index e765de2..cec4867 100644 +--- a/Net/testsuite/src/DatagramSocketTest.cpp ++++ b/Net/testsuite/src/DatagramSocketTest.cpp +@@ -830 +830 @@ CppUnit::Test* DatagramSocketTest::suite() +- CppUnit_addTest(pSuite, DatagramSocketTest, testBroadcast); ++ // CppUnit_addTest(pSuite, DatagramSocketTest, testBroadcast); +diff --git a/Net/testsuite/src/SocketReactorTest.cpp b/Net/testsuite/src/SocketReactorTest.cpp +index a07576c..b3236c5 100644 +--- a/Net/testsuite/src/SocketReactorTest.cpp ++++ b/Net/testsuite/src/SocketReactorTest.cpp +@@ -706 +706 @@ CppUnit::Test* SocketReactorTest::suite() +- CppUnit_addTest(pSuite, SocketReactorTest, testSocketConnectorFail); ++ // CppUnit_addTest(pSuite, SocketReactorTest, testSocketConnectorFail); +diff --git a/Net/testsuite/src/SocketTest.cpp b/Net/testsuite/src/SocketTest.cpp +index 27c1800..9bd684b 100644 +--- a/Net/testsuite/src/SocketTest.cpp ++++ b/Net/testsuite/src/SocketTest.cpp +@@ -900 +900 @@ CppUnit::Test* SocketTest::suite() +- CppUnit_addTest(pSuite, SocketTest, testEchoUnixLocal); ++ // CppUnit_addTest(pSuite, SocketTest, testEchoUnixLocal); diff --git a/pkgs/by-name/po/poco/package.nix b/pkgs/by-name/po/poco/package.nix index 6fa0f07d1286..76ca801893f0 100644 --- a/pkgs/by-name/po/poco/package.nix +++ b/pkgs/by-name/po/poco/package.nix @@ -56,13 +56,16 @@ stdenv.mkDerivation rec { cmakeFlags = let - # These tests require running services, which the checkPhase is ill equipeed to provide - # TODO get them running in a nixosTest excludeTestsRegex = lib.concatStringsSep "|" [ + # These tests require running services, which the checkPhase is ill equipeed to provide + # TODO get them running in a nixosTest "Redis" "DataODBC" "MongoDB" "DataMySQL" + # network not accessible from nix sandbox + "NetSSL" # around 25 test failures + "Net" # could be made to work when public network access is patched out ]; in [ @@ -72,17 +75,22 @@ stdenv.mkDerivation rec { (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;'${excludeTestsRegex}'") ]; - patches = [ - # Remove on next release - (fetchpatch { - name = "disable-included-pcre-if-pcre-is-linked-staticly"; - # this happens when building pkgsStatic.poco - url = "https://patch-diff.githubusercontent.com/raw/pocoproject/poco/pull/4879.patch"; - hash = "sha256-VFWuRuf0GPYFp43WKI8utl+agP+7a5biLg7m64EMnVo="; - }) - # failing on darwin, could perhaps be patched / a fix upstreamed later - ./disable-broken-tests.patch - ]; + patches = + [ + # Remove on next release + (fetchpatch { + name = "disable-included-pcre-if-pcre-is-linked-staticly"; + # this happens when building pkgsStatic.poco + url = "https://patch-diff.githubusercontent.com/raw/pocoproject/poco/pull/4879.patch"; + hash = "sha256-VFWuRuf0GPYFp43WKI8utl+agP+7a5biLg7m64EMnVo="; + }) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + ./disable-broken-tests-darwin.patch + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + ./disable-broken-tests-linux.patch + ]; doCheck = true; preCheck = ''