summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ahmad Khalil <khalilahmad@google.com> 2023-07-26 23:28:29 +0000
committer Ahmad Khalil <khalilahmad@google.com> 2023-07-27 12:07:42 +0000
commit454a8cc8f830629c6fb8c30aafa23e74975385a5 (patch)
tree98ea85873f56ce464f2307cc982362ee4fbf50ca
parent8fb6fd7d433f48989056356ebe9d4c77c0d34f89 (diff)
Move tests for frameworks-base-testutils lib into their own target
The test modules that include these util classes are running the util tests as well, because they're in the same java library. This change separates the util classes from their tests, with a new separate test mapping. Fix: 292212651 Test: atest frameworks-base-testutils-tests Change-Id: Ic8309a303307457e0e642370bc2a0a0335e4e8f6
-rw-r--r--tests/utils/testutils/TEST_MAPPING32
-rw-r--r--tests/utils/testutils/tests/Android.bp47
-rw-r--r--tests/utils/testutils/tests/AndroidManifest.xml29
-rw-r--r--tests/utils/testutils/tests/src/android/os/test/TestLooperTest.java (renamed from tests/utils/testutils/java/android/os/test/TestLooperTest.java)0
-rw-r--r--tests/utils/testutils/tests/src/com/android/test/filters/SelectTestTests.java (renamed from tests/utils/testutils/java/com/android/test/filters/SelectTestTests.java)0
5 files changed, 108 insertions, 0 deletions
diff --git a/tests/utils/testutils/TEST_MAPPING b/tests/utils/testutils/TEST_MAPPING
new file mode 100644
index 000000000000..d9eb44fc4222
--- /dev/null
+++ b/tests/utils/testutils/TEST_MAPPING
@@ -0,0 +1,32 @@
+{
+ "presubmit": [
+ {
+ "name": "frameworks-base-testutils-tests",
+ "options": [
+ {
+ "exclude-annotation": "android.platform.test.annotations.LargeTest"
+ },
+ {
+ "exclude-annotation": "android.platform.test.annotations.FlakyTest"
+ },
+ {
+ "exclude-annotation": "androidx.test.filters.FlakyTest"
+ },
+ {
+ "exclude-annotation": "org.junit.Ignore"
+ }
+ ]
+ }
+ ],
+ "postsubmit": [
+ {
+ "name": "frameworks-base-testutils-tests",
+ "options": [
+ {
+ "exclude-annotation": "org.junit.Ignore"
+ }
+ ]
+ }
+ ]
+}
+
diff --git a/tests/utils/testutils/tests/Android.bp b/tests/utils/testutils/tests/Android.bp
new file mode 100644
index 000000000000..b901b1802383
--- /dev/null
+++ b/tests/utils/testutils/tests/Android.bp
@@ -0,0 +1,47 @@
+//
+// Copyright (C) 2023 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 {
+ default_applicable_licenses: ["frameworks_base_license"],
+}
+
+android_test {
+ name: "frameworks-base-testutils-tests",
+
+ srcs: [
+ "src/**/*.java",
+ ],
+
+ static_libs: [
+ "junit",
+ "hamcrest-library",
+ "androidx.test.runner",
+ "mockito-target-minus-junit4",
+ "frameworks-base-testutils",
+ ],
+
+ libs: [
+ "android.test.runner",
+ "android.test.base",
+ "android.test.mock",
+ ],
+
+ certificate: "platform",
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+}
diff --git a/tests/utils/testutils/tests/AndroidManifest.xml b/tests/utils/testutils/tests/AndroidManifest.xml
new file mode 100644
index 000000000000..9e7e2752f1d5
--- /dev/null
+++ b/tests/utils/testutils/tests/AndroidManifest.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2023 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.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.frameworks.tests.utils.testutils.tests">
+
+ <application>
+ <uses-library android:name="android.test.runner"/>
+ </application>
+
+ <instrumentation
+ android:name="androidx.test.runner.AndroidJUnitRunner"
+ android:targetPackage="com.frameworks.tests.utils.testutils.tests"
+ android:label="Test Utils Tests"/>
+</manifest>
diff --git a/tests/utils/testutils/java/android/os/test/TestLooperTest.java b/tests/utils/testutils/tests/src/android/os/test/TestLooperTest.java
index c72e20ccc5ba..c72e20ccc5ba 100644
--- a/tests/utils/testutils/java/android/os/test/TestLooperTest.java
+++ b/tests/utils/testutils/tests/src/android/os/test/TestLooperTest.java
diff --git a/tests/utils/testutils/java/com/android/test/filters/SelectTestTests.java b/tests/utils/testutils/tests/src/com/android/test/filters/SelectTestTests.java
index df18985f77bf..df18985f77bf 100644
--- a/tests/utils/testutils/java/com/android/test/filters/SelectTestTests.java
+++ b/tests/utils/testutils/tests/src/com/android/test/filters/SelectTestTests.java