Switch to manual method of LXC "detection"

Just define wxLXC environment variable for the builds using LXC on
Travis.
This commit is contained in:
Vadim Zeitlin
2020-04-07 17:15:04 +02:00
parent 82cfdd07c2
commit 17c7469af3
2 changed files with 9 additions and 7 deletions

View File

@@ -9,10 +9,13 @@ matrix:
include:
- 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

View File

@@ -69,10 +69,6 @@ std::string wxTheCurrentTestClass, wxTheCurrentTestMethod;
#endif // __WXGTK__
#endif // wxUSE_GUI
#ifdef __LINUX__
#include "wx/filename.h"
#endif
#include "wx/socket.h"
#include "wx/evtloop.h"
@@ -426,9 +422,12 @@ extern bool IsRunningUnderXVFB()
extern bool IsRunningInLXC()
{
// This is simplistic but should work in the normal cases and can always be
// made more precise later if necessary.
return wxFileName::DirExists("/dev/lxd");
// 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__