summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/wifitests/AndroidManifest.xml2
-rwxr-xr-xtests/wifitests/runtests.sh2
-rw-r--r--tests/wifitests/src/com/android/server/wifi/CustomTestRunner.java33
3 files changed, 35 insertions, 2 deletions
diff --git a/tests/wifitests/AndroidManifest.xml b/tests/wifitests/AndroidManifest.xml
index 63b9542d9..dcb61c740 100644
--- a/tests/wifitests/AndroidManifest.xml
+++ b/tests/wifitests/AndroidManifest.xml
@@ -30,7 +30,7 @@
</activity>
</application>
- <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
+ <instrumentation android:name="com.android.server.wifi.CustomTestRunner"
android:targetPackage="com.android.server.wifi.test"
android:label="Frameworks Wifi Tests">
</instrumentation>
diff --git a/tests/wifitests/runtests.sh b/tests/wifitests/runtests.sh
index 529a535e6..7a34bf7dc 100755
--- a/tests/wifitests/runtests.sh
+++ b/tests/wifitests/runtests.sh
@@ -42,4 +42,4 @@ adb install -r -g "$OUT/data/app/FrameworksWifiTests/FrameworksWifiTests.apk"
adb shell am instrument -w "$@" \
-e notAnnotation com.android.server.wifi.DisabledForUpdateToAnyMatcher \
- 'com.android.server.wifi.test/android.support.test.runner.AndroidJUnitRunner'
+ 'com.android.server.wifi.test/com.android.server.wifi.CustomTestRunner'
diff --git a/tests/wifitests/src/com/android/server/wifi/CustomTestRunner.java b/tests/wifitests/src/com/android/server/wifi/CustomTestRunner.java
new file mode 100644
index 000000000..d51f16e36
--- /dev/null
+++ b/tests/wifitests/src/com/android/server/wifi/CustomTestRunner.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.wifi;
+
+import android.os.Bundle;
+import android.support.test.runner.AndroidJUnitRunner;
+import android.util.Log;
+
+import static org.mockito.Mockito.mock;
+
+public class CustomTestRunner extends AndroidJUnitRunner {
+ @Override
+ public void onCreate(Bundle arguments) {
+ // Override the default TerribleFailureHandler, as that handler might terminate
+ // the process (if we're on an eng build).
+ Log.setWtfHandler(mock(Log.TerribleFailureHandler.class));
+ super.onCreate(arguments);
+ }
+}