Merge branch 'more-travis'

Test Linux on ARM, PPC64 and S390 architectures on Travis CI too.

See https://github.com/wxWidgets/wxWidgets/pull/1783
This commit is contained in:
Vadim Zeitlin
2020-04-19 22:25:16 +02:00
6 changed files with 84 additions and 47 deletions

View File

@@ -7,42 +7,51 @@ sudo: required
matrix:
include:
- dist: precise
compiler: gcc
env: wxUSE_XVFB=1
- dist: trusty
compiler: gcc
- dist: trusty
compiler: gcc
env: wxCONFIGURE_FLAGS="--enable-utf8 --enable-utf8only --enable-monolithic" wxUSE_XVFB=1
- dist: trusty
compiler: gcc
env: wxGTK_VERSION=3 wxCONFIGURE_FLAGS="--enable-cxx11 --enable-stl --disable-webview" wxMAKEFILE_FLAGS="CXXFLAGS=-std=c++11" wxUSE_XVFB=1
- dist: trusty
compiler: clang
env: wxCONFIGURE_FLAGS="--disable-shared --disable-sys-libs --disable-webview" wxUSE_XVFB=1
- dist: trusty
compiler: gcc
env: wxTOOLSET=cmake wxCMAKE_GENERATOR="Unix Makefiles"
- os: osx
osx_image: xcode6.4
compiler: clang
env: wxCONFIGURE_FLAGS="--enable-cxx11" wxMAKEFILE_FLAGS="CXXFLAGS=-std=c++11" wxSKIP_SAMPLES=1
- os: osx
compiler: clang
env: wxTOOLSET=cmake wxCMAKE_GENERATOR=Xcode wxCMAKE_DEFINES="-DCMAKE_CXX_STANDARD=11"
- dist: trusty
compiler: gcc
env: wxCONFIGURE_FLAGS="--with-x11 --enable-pch --disable-stc" wxSKIP_SAMPLES=1
- dist: trusty
compiler: gcc
env: wxCONFIGURE_FLAGS="--with-directfb --enable-pch --disable-stc" wxSKIP_SAMPLES=1
- dist: trusty
compiler: gcc
env: wxCONFIGURE_FLAGS="--with-motif --enable-pch --disable-stc" wxSKIP_SAMPLES=1
- dist: trusty
compiler: gcc
env: wxCONFIGURE_FLAGS="--with-qt --enable-pch" wxSKIP_SAMPLES=1
- os: linux
arch: arm64
env: wxCONFIGURE_FLAGS="--disable-sys-libs" wxLXC=1
- os: linux
arch: ppc64le
env: wxCONFIGURE_FLAGS="--disable-sys-libs" wxLXC=1
- os: linux
arch: s390x
env: wxCONFIGURE_FLAGS="--disable-sys-libs" wxLXC=1
# - dist: precise
# compiler: gcc
# env: wxUSE_XVFB=1
# - dist: trusty
# compiler: gcc
# - dist: trusty
# compiler: gcc
# env: wxCONFIGURE_FLAGS="--enable-utf8 --enable-utf8only --enable-monolithic" wxUSE_XVFB=1
# - dist: trusty
# compiler: gcc
# env: wxGTK_VERSION=3 wxCONFIGURE_FLAGS="--enable-cxx11 --enable-stl --disable-webview" wxMAKEFILE_FLAGS="CXXFLAGS=-std=c++11" wxUSE_XVFB=1
# - dist: trusty
# compiler: clang
# env: wxCONFIGURE_FLAGS="--disable-shared --disable-sys-libs --disable-webview" wxUSE_XVFB=1
# - dist: trusty
# compiler: gcc
# env: wxTOOLSET=cmake wxCMAKE_GENERATOR="Unix Makefiles"
# - os: osx
# osx_image: xcode6.4
# compiler: clang
# env: wxCONFIGURE_FLAGS="--enable-cxx11" wxMAKEFILE_FLAGS="CXXFLAGS=-std=c++11" wxSKIP_SAMPLES=1
# - os: osx
# compiler: clang
# env: wxTOOLSET=cmake wxCMAKE_GENERATOR=Xcode wxCMAKE_DEFINES="-DCMAKE_CXX_STANDARD=11"
# - dist: trusty
# compiler: gcc
# env: wxCONFIGURE_FLAGS="--with-x11 --enable-pch --disable-stc" wxSKIP_SAMPLES=1
# - dist: trusty
# compiler: gcc
# env: wxCONFIGURE_FLAGS="--with-directfb --enable-pch --disable-stc" wxSKIP_SAMPLES=1
# - dist: trusty
# compiler: gcc
# env: wxCONFIGURE_FLAGS="--with-motif --enable-pch --disable-stc" wxSKIP_SAMPLES=1
# - dist: trusty
# compiler: gcc
# env: wxCONFIGURE_FLAGS="--with-qt --enable-pch" wxSKIP_SAMPLES=1
branches:
only:

View File

@@ -149,21 +149,26 @@ TEST_CASE("wxFile::Special", "[file][linux][special-file]")
// for reading) and usually we don't have the permissions to do it.
// This file is not seekable and has 0 size, but can still be read.
wxFile fileProc("/proc/diskstats");
wxFile fileProc("/proc/cpuinfo");
CHECK( fileProc.IsOpened() );
wxString s;
CHECK( fileProc.ReadAll(&s) );
// /proc files seem to be always empty in LXC containers.
if ( !IsRunningInLXC() )
CHECK( !s.empty() );
// All files in /sys seem to have size of 4KiB currently, even if they
// don't have that much data in them.
// 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);
wxFile fileSys("/sys/power/state");
CHECK( fileSys.Length() == 4096 );
CHECK( fileSys.Length() == pageSize );
CHECK( fileSys.IsOpened() );
CHECK( fileSys.ReadAll(&s) );
CHECK( !s.empty() );
CHECK( s.length() < 4096 );
CHECK( s.length() < pageSize );
}
#endif // __LINUX__

View File

@@ -1059,8 +1059,9 @@ TEST_CASE("wxFileName::GetSizeSpecial", "[filename][linux][special-file]")
INFO( "size of /proc/kcore=" << size );
CHECK( size > 0 );
// All files in /sys seem to have size of 4KiB currently.
CHECK( wxFileName::GetSize("/sys/power/state") == 4096 );
// 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__

View File

@@ -422,6 +422,20 @@ extern bool IsRunningUnderXVFB()
return s_isRunningUnderXVFB == 1;
}
#ifdef __LINUX__
extern bool IsRunningInLXC()
{
// We're supposed to be able to detect running in LXC by checking for
// /dev/lxd existency, but this doesn't work under Travis for some reason,
// so just rely on having the environment variable defined for the
// corresponding builds in our .travis.yml.
wxString value;
return wxGetEnv("wxLXC", &value) && value == "1";
}
#endif // __LINUX__
#if wxUSE_GUI
bool EnableUITests()

View File

@@ -123,6 +123,10 @@ extern bool IsAutomaticTest();
extern bool IsRunningUnderXVFB();
#ifdef __LINUX__
extern bool IsRunningInLXC();
#endif // __LINUX__
// Helper class setting the locale to the given one for its lifetime.
class LocaleSetter
{

View File

@@ -347,7 +347,11 @@ TEST_CASE("wxTextFile::Special", "[textfile][linux][special-file]")
SECTION("/proc")
{
wxTextFile f;
CHECK( f.Open("/proc/diskstats") );
CHECK( f.Open("/proc/cpuinfo") );
// /proc files seem to be always empty in LXC containers, so skip this
// check there.
if ( !IsRunningInLXC() )
CHECK( f.GetLineCount() > 1 );
}
@@ -357,7 +361,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) );
}
}