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
Родитель a51f1b21bf
Коммит c920eca88f
1 изменённых файлов: 14 добавлений и 0 удалений

Просмотреть файл

@ -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;