X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e84d9899300decdc1cfa79229c8c0b839ed2011f..a1d6c5df6f91f034663953fb5d43daa1b65187f3:/tests/test.cpp diff --git a/tests/test.cpp b/tests/test.cpp index c3bbc31191..a2a04ed98c 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -165,7 +165,7 @@ static string GetExceptionMessage() throw; } #if wxDEBUG_LEVEL - catch ( TestAssertFailure& e ) + catch ( TestAssertFailure& ) { msg = s_lastAssertMessage; s_lastAssertMessage.clear(); @@ -412,6 +412,23 @@ extern bool IsNetworkAvailable() return online; } +extern bool IsAutomaticTest() +{ + static int s_isAutomatic = -1; + if ( s_isAutomatic == -1 ) + { + // Allow setting an environment variable to emulate buildslave user for + // testing. + wxString username; + if ( !wxGetEnv("WX_TEST_USER", &username) ) + username = wxGetUserId(); + + s_isAutomatic = username.Lower().Matches("buildslave*"); + } + + return s_isAutomatic == 1; +} + // helper of OnRun(): gets the test with the given name, returning NULL (and // not an empty test suite) if there is no such test static Test *GetTestByName(const wxString& name)