]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/test.cpp
No changes, just a typo fix in wxRichTextCtrl UI code.
[wxWidgets.git] / tests / test.cpp
index c3bbc3119155f7e37c0226aced6e8e853a36a7d5..a2a04ed98c5db9e83e70a6613d1c7c0652c97204 100644 (file)
@@ -165,7 +165,7 @@ static string GetExceptionMessage()
         throw;
     }
 #if wxDEBUG_LEVEL
-    catch ( TestAssertFailure& )
+    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)