From 374de8a40916bb689b846db8885e561602579d0c Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Apr 07 2020 01:45:16 +0000 Subject: Fix tests on ppc64le and s390x --- diff --git a/fix-tests-ppc64le.patch b/fix-tests-ppc64le.patch new file mode 100644 index 0000000..c94ed56 --- /dev/null +++ b/fix-tests-ppc64le.patch @@ -0,0 +1,39 @@ +From 14c08046d40203c9d078768e4fe1bf9374865f34 Mon Sep 17 00:00:00 2001 +From: Scott Talbert +Date: Tue, 7 Apr 2020 01:48:38 +0200 +Subject: [PATCH] Fix tests when run on ppc64le arch + +--- + tests/file/filetest.cpp | 2 +- + tests/filename/filenametest.cpp | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/file/filetest.cpp b/tests/file/filetest.cpp +index f1876daf94..9692bd3c60 100644 +--- a/tests/file/filetest.cpp ++++ b/tests/file/filetest.cpp +@@ -159,7 +159,7 @@ TEST_CASE("wxFile::Special", "[file][linux][special-file]") + // All files in /sys seem to have size of 4KiB currently, even if they + // don't have that much data in them. + wxFile fileSys("/sys/power/state"); +- CHECK( fileSys.Length() == 4096 ); ++ CHECK( fileSys.Length() == sysconf(_SC_PAGESIZE) ); + CHECK( fileSys.IsOpened() ); + CHECK( fileSys.ReadAll(&s) ); + CHECK( !s.empty() ); +diff --git a/tests/filename/filenametest.cpp b/tests/filename/filenametest.cpp +index 240e95205c..2928b8d4cb 100644 +--- a/tests/filename/filenametest.cpp ++++ b/tests/filename/filenametest.cpp +@@ -1060,7 +1060,7 @@ TEST_CASE("wxFileName::GetSizeSpecial", "[filename][linux][special-file]") + //CHECK( size > 0 ); + + // All files in /sys seem to have size of 4KiB currently. +- CHECK( wxFileName::GetSize("/sys/power/state") == 4096 ); ++ CHECK( wxFileName::GetSize("/sys/power/state") == sysconf(_SC_PAGESIZE) ); + } + + #endif // __LINUX__ +-- +2.25.1 + diff --git a/fix-tests-s390x.patch b/fix-tests-s390x.patch new file mode 100644 index 0000000..7d54e21 --- /dev/null +++ b/fix-tests-s390x.patch @@ -0,0 +1,25 @@ +From 1da9e342c29b7be94fe66b510ed2d71a003c16e4 Mon Sep 17 00:00:00 2001 +From: Scott Talbert +Date: Tue, 7 Apr 2020 03:30:44 +0200 +Subject: [PATCH] Fix tests when run on s390x arch + +--- + tests/textfile/textfiletest.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/textfile/textfiletest.cpp b/tests/textfile/textfiletest.cpp +index eda450d1f3..d76cb1b244 100644 +--- a/tests/textfile/textfiletest.cpp ++++ b/tests/textfile/textfiletest.cpp +@@ -357,7 +357,7 @@ TEST_CASE("wxTextFile::Special", "[textfile][linux][special-file]") + CHECK( f.Open("/sys/power/state") ); + REQUIRE( f.GetLineCount() == 1 ); + INFO( "/sys/power/state contains \"" << f[0] << "\"" ); +- CHECK( f[0].find("mem") != wxString::npos ); ++ CHECK( (f[0].find("mem") != wxString::npos || f[0].find("disk") != wxString::npos) ); + } + } + +-- +2.25.1 + diff --git a/wxGTK.spec b/wxGTK.spec index a5ffc82..e0ea992 100644 --- a/wxGTK.spec +++ b/wxGTK.spec @@ -18,6 +18,8 @@ Source10: wx-config Patch0: %{name}-3.0.3-abicheck.patch Patch1: disable-tests-failing-mock.patch Patch2: update-license-text.patch +Patch3: fix-tests-ppc64le.patch +Patch4: fix-tests-s390x.patch BuildRequires: gcc-c++ BuildRequires: gtk3-devel