+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();
+
+ username.MakeLower();
+ s_isAutomatic = username.Matches("buildslave*") ||
+ username.Matches("sandbox*");
+ }
+
+ return s_isAutomatic == 1;
+}
+