b91582d
From d48ac8dd31d4091303af4336fcc2f37ecc49bd5c Mon Sep 17 00:00:00 2001
b91582d
From: Scott Talbert <swt@techie.net>
b91582d
Date: Wed, 5 Aug 2020 19:58:42 -0400
b91582d
Subject: [PATCH 1/2] Skip /sys/power tests on s390x architecture
b91582d
b91582d
On certain s390x hosts (e.g., the Fedora builders), /sys/power does not exist.
b91582d
---
b91582d
 tests/file/filetest.cpp         | 2 ++
b91582d
 tests/filename/filenametest.cpp | 2 ++
b91582d
 tests/textfile/textfiletest.cpp | 2 ++
b91582d
 3 files changed, 6 insertions(+)
b91582d
b91582d
diff --git a/tests/file/filetest.cpp b/tests/file/filetest.cpp
b91582d
index 0f31b12db3..83d9893462 100644
b91582d
--- a/tests/file/filetest.cpp
b91582d
+++ b/tests/file/filetest.cpp
b91582d
@@ -163,12 +163,14 @@ TEST_CASE("wxFile::Special", "[file][linux][special-file]")
b91582d
     // have that much data in them.
b91582d
     const long pageSize = sysconf(_SC_PAGESIZE);
b91582d
 
b91582d
+#if !defined(__s390x__)
b91582d
     wxFile fileSys("/sys/power/state");
b91582d
     CHECK( fileSys.Length() == pageSize );
b91582d
     CHECK( fileSys.IsOpened() );
b91582d
     CHECK( fileSys.ReadAll(&s) );
b91582d
     CHECK( !s.empty() );
b91582d
     CHECK( s.length() < pageSize );
b91582d
+#endif // !__s390x__
b91582d
 }
b91582d
 
b91582d
 #endif // __LINUX__
b91582d
diff --git a/tests/filename/filenametest.cpp b/tests/filename/filenametest.cpp
b91582d
index 12d2d571d7..37598c08ed 100644
b91582d
--- a/tests/filename/filenametest.cpp
b91582d
+++ b/tests/filename/filenametest.cpp
b91582d
@@ -1062,7 +1062,9 @@ TEST_CASE("wxFileName::GetSizeSpecial", "[filename][linux][special-file]")
b91582d
 
b91582d
     // All files in /sys are one page in size, irrespectively of the size of
b91582d
     // their actual contents.
b91582d
+#if !defined(__s390x__)
b91582d
     CHECK( wxFileName::GetSize("/sys/power/state") == sysconf(_SC_PAGESIZE) );
b91582d
+#endif // !__s390x__
b91582d
 }
b91582d
 
b91582d
 #endif // __LINUX__
b91582d
diff --git a/tests/textfile/textfiletest.cpp b/tests/textfile/textfiletest.cpp
b91582d
index dc7d22423d..ab36047450 100644
b91582d
--- a/tests/textfile/textfiletest.cpp
b91582d
+++ b/tests/textfile/textfiletest.cpp
b91582d
@@ -355,6 +355,7 @@ TEST_CASE("wxTextFile::Special", "[textfile][linux][special-file]")
b91582d
             CHECK( f.GetLineCount() > 1 );
b91582d
     }
b91582d
 
b91582d
+#if !defined(__s390x__)
b91582d
     SECTION("/sys")
b91582d
     {
b91582d
         wxTextFile f;
b91582d
@@ -363,6 +364,7 @@ TEST_CASE("wxTextFile::Special", "[textfile][linux][special-file]")
b91582d
         INFO( "/sys/power/state contains \"" << f[0] << "\"" );
b91582d
         CHECK( (f[0].find("mem") != wxString::npos || f[0].find("disk") != wxString::npos) );
b91582d
     }
b91582d
+#endif // !__s390x__
b91582d
 }
b91582d
 
b91582d
 #endif // __LINUX__
b91582d
-- 
b91582d
2.26.2
b91582d