diff --git a/tests/test.cpp b/tests/test.cpp index c291c878e8..f5135f87fb 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -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() diff --git a/tests/testprec.h b/tests/testprec.h index 9d6a6bb34a..7ae35168cc 100644 --- a/tests/testprec.h +++ b/tests/testprec.h @@ -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 {