Fix tests on ppc64le and s390x

This commit is contained in:
Scott Talbert 2020-04-06 21:45:16 -04:00
parent 0aea9ee163
commit 374de8a409
3 changed files with 66 additions and 0 deletions

39
fix-tests-ppc64le.patch Normal file
View File

@ -0,0 +1,39 @@
From 14c08046d40203c9d078768e4fe1bf9374865f34 Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
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

25
fix-tests-s390x.patch Normal file
View File

@ -0,0 +1,25 @@
From 1da9e342c29b7be94fe66b510ed2d71a003c16e4 Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
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

View File

@ -18,6 +18,8 @@ Source10: wx-config
Patch0: %{name}-3.0.3-abicheck.patch Patch0: %{name}-3.0.3-abicheck.patch
Patch1: disable-tests-failing-mock.patch Patch1: disable-tests-failing-mock.patch
Patch2: update-license-text.patch Patch2: update-license-text.patch
Patch3: fix-tests-ppc64le.patch
Patch4: fix-tests-s390x.patch
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: gtk3-devel BuildRequires: gtk3-devel