forked from pool/wxWidgets-3_2
Accepting request 1141466 from home:qzhao:branches:X11:wxWidgets
Add wxWidgets-3_2-Fix-test-suite-on-Linux-s390x-architectures.patch to fix test failure suites on Linux/s390x and maybe other architectures. OBS-URL: https://build.opensuse.org/request/show/1141466 OBS-URL: https://build.opensuse.org/package/show/X11:wxWidgets/wxWidgets-3_2?expand=0&rev=120
This commit is contained in:
parent
cbe26aaed5
commit
139df4fc99
@ -0,0 +1,71 @@
|
|||||||
|
commit e2cc16ef9c45bdc64d42e4fef4dda46a3077cb35
|
||||||
|
Author: Vadim Zeitlin <vadim@wxwidgets.org>
|
||||||
|
Date: Tue Jan 9 02:38:43 2024 +0100
|
||||||
|
|
||||||
|
Fix test suite on Linux/s390x and maybe other architectures
|
||||||
|
|
||||||
|
We can't rely on file /sys/power/state always existing, so just skip the
|
||||||
|
test (with a warning) instead of failing it if it does not exist, as is
|
||||||
|
the case at least under s390x and seemingly other non-desktop platforms.
|
||||||
|
|
||||||
|
Closes #24197.
|
||||||
|
|
||||||
|
Co-authored-by: Cliff Zhao <qzhao@suse.com>
|
||||||
|
|
||||||
|
diff -Nura wxWidgets-3.2.4/tests/file/filetest.cpp wxWidgets-3.2.4_new/tests/file/filetest.cpp
|
||||||
|
--- wxWidgets-3.2.4/tests/file/filetest.cpp 2023-11-09 06:53:55.000000000 +0800
|
||||||
|
+++ wxWidgets-3.2.4_new/tests/file/filetest.cpp 2024-01-24 17:12:00.649890837 +0800
|
||||||
|
@@ -158,8 +158,13 @@
|
||||||
|
const long pageSize = sysconf(_SC_PAGESIZE);
|
||||||
|
|
||||||
|
wxFile fileSys("/sys/power/state");
|
||||||
|
+ if ( !fileSys.IsOpened() )
|
||||||
|
+ {
|
||||||
|
+ WARN("/sys/power/state can't be opened, skipping test");
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
CHECK( fileSys.Length() == pageSize );
|
||||||
|
- CHECK( fileSys.IsOpened() );
|
||||||
|
CHECK( fileSys.ReadAll(&s) );
|
||||||
|
CHECK( !s.empty() );
|
||||||
|
CHECK( s.length() < pageSize );
|
||||||
|
diff -Nura wxWidgets-3.2.4/tests/filename/filenametest.cpp wxWidgets-3.2.4_new/tests/filename/filenametest.cpp
|
||||||
|
--- wxWidgets-3.2.4/tests/filename/filenametest.cpp 2023-11-09 06:53:55.000000000 +0800
|
||||||
|
+++ wxWidgets-3.2.4_new/tests/filename/filenametest.cpp 2024-01-24 17:13:36.039991014 +0800
|
||||||
|
@@ -1040,6 +1040,12 @@
|
||||||
|
INFO( "size of /proc/kcore=" << size );
|
||||||
|
CHECK( size > 0 );
|
||||||
|
|
||||||
|
+ if ( !wxFile::Exists("/sys/power/state") )
|
||||||
|
+ {
|
||||||
|
+ WARN("/sys/power/state doesn't exist, skipping test");
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
// All files in /sys are one page in size, irrespectively of the size of
|
||||||
|
// their actual contents.
|
||||||
|
CHECK( wxFileName::GetSize("/sys/power/state") == sysconf(_SC_PAGESIZE) );
|
||||||
|
diff -Nura wxWidgets-3.2.4/tests/textfile/textfiletest.cpp wxWidgets-3.2.4_new/tests/textfile/textfiletest.cpp
|
||||||
|
--- wxWidgets-3.2.4/tests/textfile/textfiletest.cpp 2023-11-09 06:53:55.000000000 +0800
|
||||||
|
+++ wxWidgets-3.2.4_new/tests/textfile/textfiletest.cpp 2024-01-24 17:15:03.777002930 +0800
|
||||||
|
@@ -344,12 +344,18 @@
|
||||||
|
SECTION("/proc")
|
||||||
|
{
|
||||||
|
wxTextFile f;
|
||||||
|
- CHECK( f.Open("/proc/cpuinfo") );
|
||||||
|
+ REQUIRE( f.Open("/proc/cpuinfo") );
|
||||||
|
CHECK( f.GetLineCount() > 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
SECTION("/sys")
|
||||||
|
{
|
||||||
|
+ if ( wxFile::Exists("/sys/power/state") )
|
||||||
|
+ {
|
||||||
|
+ WARN("/sys/power/state doesn't exist, skipping test");
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
wxTextFile f;
|
||||||
|
CHECK( f.Open("/sys/power/state") );
|
||||||
|
REQUIRE( f.GetLineCount() == 1 );
|
@ -1,88 +0,0 @@
|
|||||||
From 891bfff867b7dc92ed6330ea46ee2dcfa5424ee0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Cliff Zhao <qzhao@suse.com>
|
|
||||||
Date: Thu, 4 Jan 2024 08:01:00 +0100
|
|
||||||
Subject: [PATCH] Fix testsuite failures on s390x
|
|
||||||
|
|
||||||
``/sys/power/state`` does not exist on s390x platforms and certain
|
|
||||||
types of containers, so check that the file exist before running the
|
|
||||||
test case.
|
|
||||||
|
|
||||||
Output from ``make check`` was:
|
|
||||||
|
|
||||||
./textfile/textfiletest.cpp:351
|
|
||||||
...............................................................................
|
|
||||||
|
|
||||||
./textfile/textfiletest.cpp:354: FAILED:
|
|
||||||
CHECK( f.Open("/sys/power/state") )
|
|
||||||
with expansion:
|
|
||||||
false
|
|
||||||
|
|
||||||
./textfile/textfiletest.cpp:355: FAILED:
|
|
||||||
REQUIRE( f.GetLineCount() == 1 )
|
|
||||||
with expansion:
|
|
||||||
0 == 1
|
|
||||||
---
|
|
||||||
tests/file/filetest.cpp | 2 ++
|
|
||||||
tests/filename/filenametest.cpp | 2 ++
|
|
||||||
tests/textfile/textfiletest.cpp | 2 ++
|
|
||||||
3 files changed, 6 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/tests/file/filetest.cpp b/tests/file/filetest.cpp
|
|
||||||
index 8902eb4d66..fc3c905694 100644
|
|
||||||
--- a/tests/file/filetest.cpp
|
|
||||||
+++ b/tests/file/filetest.cpp
|
|
||||||
@@ -153,6 +153,7 @@ TEST_CASE("wxFile::Special", "[file][linux][special-file]")
|
|
||||||
CHECK( fileProc.ReadAll(&s) );
|
|
||||||
CHECK( !s.empty() );
|
|
||||||
|
|
||||||
+ if ( wxFile::Exists("/sys/power/state") ) {
|
|
||||||
// All files in /sys have the size of one kernel page, even if they don't
|
|
||||||
// have that much data in them.
|
|
||||||
const long pageSize = sysconf(_SC_PAGESIZE);
|
|
||||||
@@ -163,6 +164,7 @@ TEST_CASE("wxFile::Special", "[file][linux][special-file]")
|
|
||||||
CHECK( fileSys.ReadAll(&s) );
|
|
||||||
CHECK( !s.empty() );
|
|
||||||
CHECK( s.length() < pageSize );
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __LINUX__
|
|
||||||
diff --git a/tests/filename/filenametest.cpp b/tests/filename/filenametest.cpp
|
|
||||||
index 84356b39f7..ce2ec2af27 100644
|
|
||||||
--- a/tests/filename/filenametest.cpp
|
|
||||||
+++ b/tests/filename/filenametest.cpp
|
|
||||||
@@ -1040,9 +1040,11 @@ TEST_CASE("wxFileName::GetSizeSpecial", "[filename][linux][special-file]")
|
|
||||||
INFO( "size of /proc/kcore=" << size );
|
|
||||||
CHECK( size > 0 );
|
|
||||||
|
|
||||||
+ if ( wxFile::Exists("/sys/power/state") ) {
|
|
||||||
// All files in /sys are one page in size, irrespectively of the size of
|
|
||||||
// their actual contents.
|
|
||||||
CHECK( wxFileName::GetSize("/sys/power/state") == sysconf(_SC_PAGESIZE) );
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __LINUX__
|
|
||||||
diff --git a/tests/textfile/textfiletest.cpp b/tests/textfile/textfiletest.cpp
|
|
||||||
index f744ffc327..73467be8f8 100644
|
|
||||||
--- a/tests/textfile/textfiletest.cpp
|
|
||||||
+++ b/tests/textfile/textfiletest.cpp
|
|
||||||
@@ -348,6 +348,7 @@ TEST_CASE("wxTextFile::Special", "[textfile][linux][special-file]")
|
|
||||||
CHECK( f.GetLineCount() > 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if ( wxFile::Exists("/sys/power/state") ) {
|
|
||||||
SECTION("/sys")
|
|
||||||
{
|
|
||||||
wxTextFile f;
|
|
||||||
@@ -356,6 +357,7 @@ TEST_CASE("wxTextFile::Special", "[textfile][linux][special-file]")
|
|
||||||
INFO( "/sys/power/state contains \"" << f[0] << "\"" );
|
|
||||||
CHECK( (f[0].find("mem") != wxString::npos || f[0].find("disk") != wxString::npos) );
|
|
||||||
}
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // __LINUX__
|
|
||||||
--
|
|
||||||
2.43.0
|
|
||||||
|
|
@ -1,3 +1,14 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun Jan 21 09:21:37 UTC 2024 - Cliff Zhao <qzhao@suse.com>
|
||||||
|
|
||||||
|
- Add wxWidgets-3_2-Fix-test-suite-on-Linux-s390x-architectures.patch:
|
||||||
|
Backporting e2cc16ef from upstream, Fix test suite on Linux/s390x
|
||||||
|
and maybe other architectures.
|
||||||
|
- Drop wxWidgets-3_2-fix-building-fault-S390.patch:
|
||||||
|
Patch has been merged by upstream,and they did this modification
|
||||||
|
during accept.
|
||||||
|
(bsc#1217026)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Dec 28 08:21:30 UTC 2023 - Cliff Zhao <qzhao@suse.com>
|
Thu Dec 28 08:21:30 UTC 2023 - Cliff Zhao <qzhao@suse.com>
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ Source5: wxWidgets-3_2-rpmlintrc
|
|||||||
Source6: wxpython-mkdiff.sh
|
Source6: wxpython-mkdiff.sh
|
||||||
Patch0: soversion.diff
|
Patch0: soversion.diff
|
||||||
Patch1: autoconf-2_72.diff
|
Patch1: autoconf-2_72.diff
|
||||||
Patch2: wxWidgets-3_2-fix-building-fault-S390.patch
|
Patch2: wxWidgets-3_2-Fix-test-suite-on-Linux-s390x-architectures.patch
|
||||||
%if "%{flavor}" == "doc"
|
%if "%{flavor}" == "doc"
|
||||||
BuildRequires: doxygen
|
BuildRequires: doxygen
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
|
Loading…
Reference in New Issue
Block a user