summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemi NGUYEN VAN <reminv@google.com>2019-09-06 15:16:29 +0900
committerRemi NGUYEN VAN <reminv@google.com>2019-10-30 17:01:37 +0900
commit5f48efe6935a3823099b48a46bee0217b10a1bb3 (patch)
tree422b236137eb8b2fe27ab6103425f8bd685240d9
parent6f0cef7973200b5830e728e289b6c5ec865fd989 (diff)
Add tests for stable API NetworkStack to presubmit
The API stable (system_29 at the moment) version of the NetworkStack needs to be covered by unit tests in presubmit. At the moment any difference between NetworkStackNext and NetworkStack is dead code, so NetworkStackNextTests and NetworkStackTests are identical. This change renames NetworkStackTests to NetworkStackNextTests (because NetworkStackTests historically used the "current", non-stable-API version of the NetworkStack library), and adds tests for the stable API version of the code as NetworkStackTests. Test: atest NetworkStackTests NetworkStackApiStableTests Change-Id: Iff9a94a7398791adbe856008bc4f9b6c131c3de7
-rw-r--r--TEST_MAPPING3
-rw-r--r--tests/unit/Android.bp21
2 files changed, 20 insertions, 4 deletions
diff --git a/TEST_MAPPING b/TEST_MAPPING
index e5c8117..48370c0 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -2,6 +2,9 @@
"presubmit": [
{
"name": "NetworkStackTests"
+ },
+ {
+ "name": "NetworkStackNextTests"
}
],
"postsubmit": [
diff --git a/tests/unit/Android.bp b/tests/unit/Android.bp
index 03bcf95..1b67041 100644
--- a/tests/unit/Android.bp
+++ b/tests/unit/Android.bp
@@ -14,18 +14,16 @@
// limitations under the License.
//
-android_test {
- name: "NetworkStackTests",
+java_defaults {
+ name: "NetworkStackTestsDefaults",
certificate: "platform",
srcs: ["src/**/*.java", "src/**/*.kt"],
- test_suites: ["device-tests"],
resource_dirs: ["res"],
static_libs: [
"androidx.test.rules",
"kotlin-reflect",
"mockito-target-extended-minus-junit4",
"net-tests-utils",
- "NetworkStackApiCurrentLib",
"testables",
],
libs: [
@@ -42,6 +40,21 @@ android_test {
],
}
+android_test {
+ name: "NetworkStackNextTests",
+ srcs: [], // TODO: tests that only apply to the current, non-stable API can be added here
+ test_suites: ["device-tests"],
+ defaults: ["NetworkStackTestsDefaults"],
+ static_libs: ["NetworkStackApiCurrentLib"],
+}
+
+android_test {
+ name: "NetworkStackTests",
+ test_suites: ["device-tests"],
+ defaults: ["NetworkStackTestsDefaults"],
+ static_libs: ["NetworkStackApiStableLib"],
+}
+
// Additional dependencies of libnetworkstackutilsjni that are not provided by the system when
// running as a test application.
// Using java_defaults as jni_libs does not support filegroups.