Bug 764527 - Catch exceptions thrown during robocop tests. r=jmaher

This commit is contained in:
Kartikaya Gupta 2012-06-13 16:31:01 -04:00
parent 24d43876fd
commit 35421a395a

View File

@ -74,6 +74,20 @@ abstract class BaseTest extends ActivityInstrumentationTestCase2<Activity> {
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;