Add a helper IsRunningUnderXvfb() function to the test suite
This will allow disabling some tests which fail when running only under Xvfb. The new function doesn't work automatically because there doesn't seem to be any way to distinguish it from the usual server, so it just checks whether wxUSE_XVFB=1 is set in the environment, as is done by Travis CI build script.
This commit is contained in:
@@ -406,6 +406,18 @@ extern bool IsAutomaticTest()
|
||||
return s_isAutomatic == 1;
|
||||
}
|
||||
|
||||
extern bool IsRunningUnderXVFB()
|
||||
{
|
||||
static int s_isRunningUnderXVFB = -1;
|
||||
if ( s_isRunningUnderXVFB == -1 )
|
||||
{
|
||||
wxString value;
|
||||
s_isRunningUnderXVFB = wxGetEnv("wxUSE_XVFB", &value) && value == "1";
|
||||
}
|
||||
|
||||
return s_isRunningUnderXVFB == 1;
|
||||
}
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
bool EnableUITests()
|
||||
|
@@ -121,6 +121,8 @@ extern bool IsNetworkAvailable();
|
||||
|
||||
extern bool IsAutomaticTest();
|
||||
|
||||
extern bool IsRunningUnderXVFB();
|
||||
|
||||
// Helper class setting the locale to the given one for its lifetime.
|
||||
class LocaleSetter
|
||||
{
|
||||
|
Reference in New Issue
Block a user