Bug 764527 - Catch exceptions thrown during robocop tests. r=jmaher
☠☠ backed out by 124cfff79386 ☠ ☠
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 13 Jun 2012 16:31:01 -0400
changeset 101431 ed4548cac45fe74300ef7aa9a20be9e67b4679cc
parent 101430 ada741a2c92fe4d1b0aba7234aa62af7b30e8bfd
child 101432 8b34c182b276f12ed95b0fb74a2b40cbab2c8e75
push id1316
push userakeybl@mozilla.com
push dateMon, 27 Aug 2012 22:37:00 +0000
treeherdermozilla-beta@db4b09302ee2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs764527
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 764527 - Catch exceptions thrown during robocop tests. r=jmaher
mobile/android/base/tests/BaseTest.java.in
--- a/mobile/android/base/tests/BaseTest.java.in
+++ b/mobile/android/base/tests/BaseTest.java.in
@@ -69,16 +69,30 @@ abstract class BaseTest extends Activity
         mDriver = new FennecNativeDriver(mActivity, mSolo);
         mActions = new FennecNativeActions(mActivity, mSolo, getInstrumentation());
 
         mLogFile = (String)config.get("logfile");
         mBaseUrl = ((String)config.get("host")).replaceAll("(/$)", "");
         mRawBaseUrl = ((String)config.get("rawhost")).replaceAll("(/$)", "");
     }
 
+    @Override
+    protected void runTest() throws Throwable {
+        try {
+            super.runTest();
+        } catch (Throwable t) {
+            if (mAsserter != null) {
+                mAsserter.dumpLog("Exception caught during test!", t);
+                mAsserter.ok(false, "Exception caught", t.toString());
+            }
+            // re-throw to continue bail-out
+            throw t;
+        }
+    }
+
     public void setTestType(String type) {
         mTestType = type;
 
         if (mTestType.equals("talos")) {
             mAsserter = new FennecTalosAssert();
         } else {
             mAsserter = new FennecMochitestAssert();
         }