blob: 25dd84aecb45a53aa18f498794d50b637aa5be59 [file] [log] [blame]
Jeff Sharkeyc55994b2019-12-20 19:43:59 -07001// This looks a bit awkward, but we need our tests to run against either
2// MediaProvider or MediaProviderGoogle, and we don't know which one is
3// on the device being tested, so we can't sign our tests with a key that
4// will allow instrumentation. Thus we pull all the sources we need to
5// run tests against into the test itself.
felkachang775842b2018-10-16 17:05:44 +08006android_test {
7 name: "MediaProviderTests",
Jeff Sharkey113f34d2019-12-08 15:27:56 -07008 test_suites: [
9 "device-tests",
Kimberly Kreider61f05992020-12-15 16:19:16 -080010 "mts-mediaprovider",
Jeff Sharkey113f34d2019-12-08 15:27:56 -070011 ],
Jeff Sharkeyd571f8c2020-04-08 21:37:38 -060012 compile_multilib: "both",
felkachang775842b2018-10-16 17:05:44 +080013
14 manifest: "AndroidManifest.xml",
15
Jeff Sharkeyc55994b2019-12-20 19:43:59 -070016 resource_dirs: [
17 "main_res",
18 "res",
19 ],
Abhijeet Kaur81c83b12020-12-04 15:30:53 +000020
felkachang775842b2018-10-16 17:05:44 +080021 srcs: [
Anton Hansson65958d02020-03-31 21:05:53 +010022 ":framework-mediaprovider-sources",
Jeff Sharkeyc55994b2019-12-20 19:43:59 -070023 ":mediaprovider-sources",
Abhijeet Kaur81c83b12020-12-04 15:30:53 +000024 ":mediaprovider-testutils",
felkachang775842b2018-10-16 17:05:44 +080025 "src/**/*.java",
26 ],
27
28 libs: [
29 "android.test.base",
30 "android.test.mock",
31 "android.test.runner",
Artur Satayev2bb438d2020-01-23 15:26:14 +000032 "unsupportedappusage",
felkachang775842b2018-10-16 17:05:44 +080033 ],
34
35 static_libs: [
Jeff Sharkeyc55994b2019-12-20 19:43:59 -070036 "androidx.appcompat_appcompat",
37 "androidx.core_core",
Brett Chabotc3a0f782018-12-13 19:06:19 -080038 "androidx.test.rules",
Jeff Sharkeyc55994b2019-12-20 19:43:59 -070039 "guava",
felkachang775842b2018-10-16 17:05:44 +080040 "mockito-target",
Jeff Sharkey0fac9412020-04-01 22:59:39 -060041 "truth-prebuilt",
felkachang775842b2018-10-16 17:05:44 +080042 ],
43
44 certificate: "media",
45
Jeff Sharkeyc55994b2019-12-20 19:43:59 -070046 aaptflags: ["--custom-package com.android.providers.media"],
Jeff Sharkeyb3e66032020-05-03 11:34:41 -060047
48 errorprone: {
49 javacflags: [
50 "-Xep:CatchFail:ERROR",
51 "-Xep:MissingFail:ERROR",
52 ],
53 },
felkachang775842b2018-10-16 17:05:44 +080054}
Abhijeet Kaur81c83b12020-12-04 15:30:53 +000055
56filegroup {
57 name: "mediaprovider-testutils",
58 srcs: ["utils/**/*.java"],
59}