diff --git a/mobile/android/base/tests/BaseTest.java.in b/mobile/android/base/tests/BaseTest.java.in index 52abd6b46f3..593049dce64 100644 --- a/mobile/android/base/tests/BaseTest.java.in +++ b/mobile/android/base/tests/BaseTest.java.in @@ -74,6 +74,20 @@ abstract class BaseTest extends ActivityInstrumentationTestCase2 { 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;