summaryrefslogtreecommitdiff
path: root/test-runner
AgeCommit message (Collapse)Author
2018-02-26Remove repackaged.android.test.mockPaul Duffin
The repackaged.android.test.mock uses internal APIs so cannot be built against the SDK which means that anything that depends on it cannot guarantee to run if those internal APIs change. That library was built because the classes in repackaged.android.test.runner depend on them. However, the repackaged.android.test.runner library is only used by the cts-api-signature-test target and it does not use any android.test.mock classes directly, or indirectly. Therefore, this simply excludes any classes from repackaged.android.test.runner that depend on android.test.mock classes so that repackaged.android.test.mock can be removed altogether. Bug: 69899800 Bug: 30188076 Test: make checkbuild Change-Id: If4528e6a4ec2b08faffd6d413672c5004d85e0a9
2018-02-22Merge changes I8e432950,Id325b8cfTreehugger Robot
* changes: Build android.test.base/legacy against SDK Fix visibility issues with android.test.mock.stubs
2018-02-22Build android.test.runner and its variants with SDKJiyong Park
They are not using any private APIs, thus eligible to be built with SDK. Test: m -j Change-Id: I82c7e2a739a40d6d2f1488164b25503a8a454b0d
2018-02-21Build android.test.base/legacy against SDKPaul Duffin
android.test.legacy is now build against SDK, thus available to apps build with SDK. In doing so, android.test.mock.stubs had to be built with SDK (because it is used by android.test.legacy). However, this wasn't trivial. The problem was that some classes in test-mock implemented abstract methods of platform classes. Even though they are marked as @hide, doclava automatically emit them to the stub file because otherwise the class in the stub file does not implement some abstract methods from its parent class, which in turn makes the stub file non-compilable. This CL solves the problem by introducing an adapter class in between the class in test-mock and the class in the framework. The adapter class implements abstract methods which are @hide and having reference to types that aren't available to SDK. The abstract methods are removed from the original class. Then doclava does not emit the abstract methods. Also by @hide'ing the adapter classes, they are not compiled when building the stub library. Bug: 30188076 Bug: 73339598 Test: m -j android.test.base Test: m -j android.test.legacy Test: m -j android.test.mock.stubs are successful and do not show link-check warning Merged-In: I8e432950e693ee3c6f0240852e62da6133d31571 Change-Id: I8e432950e693ee3c6f0240852e62da6133d31571
2018-02-21Merge "Build android.test.base/legacy against SDK"TreeHugger Robot
2018-02-19Merge "Turn on DepAnn for test-base and test-runner" am: 8dbbc3543e am: ↵Paul Duffin
38a916fb74 am: 01bdda9de8 Change-Id: I6805f692437719838bef7a4b7e51b3130d6f384e
2018-02-18Build android.test.base/legacy against SDKPaul Duffin
android.test.legacy is now build against SDK, thus available to apps build with SDK. In doing so, android.test.mock.stubs had to be built with SDK (because it is used by android.test.legacy). However, this wasn't trivial. The problem was that some classes in test-mock implemented abstract methods of platform classes. Even though they are marked as @hide, doclava automatically emit them to the stub file because otherwise the class in the stub file does not implement some abstract methods from its parent class, which in turn makes the stub file non-compilable. This CL solves the problem by introducing an adapter class in between the class in test-mock and the class in the framework. The adapter class implements abstract methods which are @hide and having reference to types that aren't available to SDK. The abstract methods are removed from the original class. Then doclava does not emit the abstract methods. Also by @hide'ing the adapter classes, they are not compiled when building the stub library. Bug: 30188076 Bug: 73339598 Test: m -j android.test.base Test: m -j android.test.legacy Test: m -j android.test.mock.stubs are successful and do not show link-check warning Change-Id: I8e432950e693ee3c6f0240852e62da6133d31571
2018-02-16Turn on DepAnn for test-base and test-runnerPaul Duffin
Bug: 30188076 Test: m -j20 RUN_ERROR_PRONE=true android.test.base android.test.runner Change-Id: I735e3fbfcc710f1dc1b96e04f91b9feda8727b6c
2018-02-07Merge "Pin jarjar targets to java_version 1.8." am: 2bbf12aa78 am: 3f48e86917Tobias Thierer
am: be3a10993f Change-Id: Ib098b09674edb62f5a27be70f4c3be911a7e0cf6
2018-02-07Merge "Pin jarjar targets to java_version 1.8."Tobias Thierer
2018-02-06Merge "Correct inaccurate comments in build files" am: f55f221805 am: 654f09c3ddPaul Duffin
am: 0c0d7091e6 Change-Id: I3c126807e8dc354e603baa439e05ac1e5a9c8676
2018-02-06Modify android.test.runner to use new mock APIsPaul Duffin
Previous change added some new public APIs to allow the android.test.runner classes to be built against the public API stubs rather than the internal classes. This change updates the android.test.runner classes to use that new API. This in turn is preparation for building an android.test.legacy library that can be safely statically included in APKs. Bug: 30188076 Test: make checkbuild (cherry picked from commit 20af1df63f77f6b3ab12fd6221f581fe84182091) Merged-In: I302626abb7e048ef0c3169e9a5209b85f2f87d34 Change-Id: Ie05a17598fcabc1189cacc912c01a25782ebd29c
2018-02-06Correct inaccurate comments in build filesPaul Duffin
Bug: 30188076 Test: make checkbuild Change-Id: I3881e66a949bfc5fbc34db0a104ef7a6995abe35
2018-02-05Pin jarjar targets to java_version 1.8.Tobias Thierer
This CL pins the following make targets to java_version 1.8, which is currently the default: framework-protos repackaged.android.test.base repackaged.android.test.mock repackaged.android.test.runner For consistency, their dependencies, android.test.base android.test.mock android.test.runner which contain .java source files, are also pinned to 1.8. This is so that the two steps: a) update jarjar to support v53 class files b) support -target 1.9 in the rest of the toolchain can be completed in any order, in future CLs. Before this CL, they would have needed to be completed in order a), b). Bug: 72703434 Test: EXPERIMENTAL_USE_OPENJDK9=true USE_R8=true make checkbuild docs (in a client where CL http://r.android.com/596874 was reverted) Change-Id: If78067294ae7ab78997aa109b0e08be427bdf0b8
2018-01-31Create test-legacy/ for android.test.legacy targetPaul Duffin
The android.test.legacy (and legacy-android-test) target depends on code from both test-base/ and test-runner/ and do not really belong in either folder. Having a separate folder will also provide a convenient place for the artifacts needed to publish android.test.legacy to maven.google.com. Bug: 30188076 Test: make checkbuild (cherry picked from commit 898e7de6c71e00e11f299b67bd62d4af5fd12ca2) Change-Id: I0538281980a55178dd72e5fae16d817cd31aa104
2018-01-30Build test-runner/testsPaul Duffin
Previous change e254526f0fe5d22681555bd4a00b7ee96fee1dc1 inadvertently removed the line to include the tests/Android.mk file. (cherry picked from commit 006b7a2b760b89211b9530804118a8333cee314b) Bug: 30188076 Test: make checkbuild Change-Id: I59bd6ec5d317eb6306642974902e4c061e594aa8 Merged-In: Ia0ba14a70d2232d464420265a7a5f9c4dde3661b
2018-01-30Use prebuilt android.test. stubs jars for app buildsPaul Duffin
(cherry picked from commit e144602d9c94d46b2da11d70f526d747b5e05750) Bug: 30188076 Test: tapas Launcher3 Change-Id: I48864d48098cfa02e15a6eaf8e4d6b53afc5b56c Merged-In: If632c39c9d98d89d597d410ebc7973903c9fa91e
2018-01-30Build stubs against SDK and clear local variablesPaul Duffin
The stubs need to be built against the current SDK where possible and not the internal modules. (cherry picked from commit d41d847c83c598082a6572f38d0d40f5dee427ef) Bug: 30188076 Test: delete stub files and remake targets Change-Id: I9b46a4e2be341fed7e5b33bbf1a80d88c5486ae6 Merged-In: Id724c16e56d1e8fe7f61cfafe7f11ea27e01e659
2018-01-26Add android.test.legacy.jar to SDK buildPaul Duffin
This is needed in order to create a prebuilts version of this JAR that can be used for unbundled builds. Bug: 30188076 Test: wait for pi-release build and check Change-Id: Ia7ae0db4ae20e9e70c1430f50f4574d1a777564d
2018-01-16Merge "Replace legacy-test with android.test.base in bp files" am: ↵Paul Duffin
2285630e4b am: caacf3e7c4 am: 2b3bf45c73 Change-Id: I0c4b7705176b0ae7eb4b06bf5a138757d6b16e9c
2018-01-15Replace legacy-test with android.test.base in bp filesPaul Duffin
The legacy-test target is deprecated and will be replaced by android.test.base. This replaces a few usages of the legacy-test target in Android.bp files with android.test.base. Bug: 30188076 Test: make checkbuild Change-Id: I3575f638114fe2a3b703e67837496346bde24472
2018-01-15Switch legacy-test to android.test.base to match AOSPPaul Duffin
Bug: 30188076 Test: make checkbuild Change-Id: I359b8840304656e9c9c08b1e7367a6b088202064
2018-01-13Merge "Remove junit classes from legacy-android-test" am: 4418418adb am: ↵Paul Duffin
d724c112f3 am: 8e632576ed Change-Id: I5b8f7a0c93e90741f0eba1d0761d2c26e8b24513
2018-01-13Remove junit classes from legacy-android-testPaul Duffin
A mistake during the conversion of the legacy-android-test target from Android.mk to Android.bp caused some junit classes to be accidentally included in the legacy-android-test target. That caused some warnings about duplicate classes to be output during the build. The junit classes are being included as part of the static library android.test.runner. This fixes that by adding a new android.test.runner-minus-junit which excludes the junit classes and then using that instead. Test: make checkbuild Change-Id: Icd00b38c64d3416a55c1055f9716ddb78ec278f8
2018-01-12Added new android.test.base targetsPaul Duffin
Renames ...-legacy-test-... targets related to stubs generation to ...-android-test-base-.... (cherry picked from commit 5c99382a1995723637814221cd5432c458c622ad) Bug: 30188076 Test: make checkbuild Change-Id: I40b39c5250b7d990a903052c0b1ebd694242b5b3 Merged-Id: I54204733612d6d3f14dd8023973e993a5ddab51d
2018-01-12Move legacy-test to test-basePaul Duffin
Make it consistent with the test-mock and test-runner directories. Also renames the files in api/ subdirectory. (cherry picked from commit f779efd62cd579f67bd3b387d59fda11ee0cbe90) Bug: 30188076 Test: make checkbuild Change-Id: Ied3621e6201d8717223fe1ccd4ea77d458126b25 Merged-In: If4f99a65fcca416ede5b3e63481398f0b451bcb7
2018-01-09Add android.test.legacy targetPaul Duffin
Adds a library that builds against the public API and so can be safely statically included into applications to avoid them having to depend on the android.test.base and android.test.runner runtime libraries. Bug: 30188076 Test: make checkbuild Change-Id: Iae7e3c64392e11035322092ed8e194740ba2d321
2018-01-09Modify android.test.runner to use new mock APIsPaul Duffin
Previous change added some new public APIs to allow the android.test.runner classes to be built against the public API stubs rather than the internal classes. This change updates the android.test.runner classes to use that new API. This in turn is preparation for building an android.test.legacy library that can be safely statically included in APKs. Bug: 30188076 Test: make checkbuild Change-Id: I302626abb7e048ef0c3169e9a5209b85f2f87d34
2017-12-12Convert legacy-test, test-runner, and test-mock to Android.bpColin Cross
See build/soong/README.md for more information. Test: m checkbuild Change-Id: I110f752d2fa94c44581f20d4f308d9d429da0517 Merged-In: I110f752d2fa94c44581f20d4f308d9d429da0517 (cherry-picked from commit 2b7d71c7f8028741c2200bfeba8913b7f4f55cde)
2017-12-12Separate android.test.mock from test-runner sourcePaul Duffin
Extracts the source for the android.test.mock library from the frameworks/base/test-runner directory into its own frameworks/base/test-mock directory. They are already treated separately at runtime and compile time so this just makes the separation complete. Bug: 30188076 Test: make checkbuild Change-Id: I20e5b06ba79677e76117c82e9f9e2ecd15e5fed6 Merged-In: I20e5b06ba79677e76117c82e9f9e2ecd15e5fed6 (cherry picked from commit e254526f0fe5d22681555bd4a00b7ee96fee1dc1)
2017-12-11Stop statically including legacy-android-testPaul Duffin
Statically including legacy-android-test leads to duplicate classes which causes build time problems (with Proguard) and runtime problems on older SDK versions. This change: * Stops statically including legacy-android-test. * Adds compile time dependencies on andoid.test.base, android.test.mock and android.test.runner where necessary. * Adds <uses-library android:name="android.test.runner"/> to any affected package to ensure that the classes that were included by legacy-android-test are still available at runtime. That also adds a dependency on android.test.base and android.test.mock. The following change descriptions were generated automatically and so may be a little repetitive. They are provided to give the reviewer enough information to check the comments match what has actually been changed and check the reasoning behind the changes. * test-runner/tests/Android.mk Added 'android.test.base' and 'android.test.mock' to LOCAL_JAVA_LIBRARIES because FrameworkTestRunnerTests's source depends on their classes and because of these changes they are no longer present on the compilation path. Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES because statically including the classes in FrameworkTestRunnerTests results in duplicate classes which leads to build time and compile time issues. Bug: 30188076 Test: make checkbuild Change-Id: I52a91fe4f6016de8edf4753fbd2bc4d2e4c9f317
2017-12-11Build test-runner/testsPaul Duffin
Previous change e254526f0fe5d22681555bd4a00b7ee96fee1dc1 inadvertently removed the line to include the tests/Android.mk file. Bug: 30188076 Test: make checkbuild Change-Id: Ia0ba14a70d2232d464420265a7a5f9c4dde3661b
2017-12-08Convert legacy-test, test-runner, and test-mock to Android.bpColin Cross
See build/soong/README.md for more information. Test: m checkbuild Change-Id: I110f752d2fa94c44581f20d4f308d9d429da0517
2017-12-07Deeper sanity checking of emitted types.Jeff Sharkey
When emitting a method or field, verify that we're able to reference all mentioned types. This ensures that we don't accidentally reference undefined classes/interfaces. Test: manual inspection of API files Bug: 69791141 Change-Id: I84e0c87fe83daa118661f61dbdf17b58ea5282d4 Merged-In: I84e0c87fe83daa118661f61dbdf17b58ea5282d4
2017-12-06Emit all APIs using Predicates.Jeff Sharkey
Generate APIs using updated doclava. Test: manual inspection of API text files Bug: 69505783 Change-Id: I2efd22998a64ebb57588b073c4a591242f4aef91 Merged-In: I2efd22998a64ebb57588b073c4a591242f4aef91
2017-11-28Added new android.test.base targetsPaul Duffin
Renames ...-legacy-test-... targets related to stubs generation to ...-android-test-base-.... Bug: 30188076 Test: make checkbuild Change-Id: I54204733612d6d3f14dd8023973e993a5ddab51d
2017-11-28Move legacy-test to test-basePaul Duffin
Make it consistent with the test-mock and test-runner directories. Also renames the files in api/ subdirectory. Bug: 30188076 Test: make checkbuild Change-Id: If4f99a65fcca416ede5b3e63481398f0b451bcb7
2017-11-27Deeper sanity checking of emitted types.Jeff Sharkey
When emitting a method or field, verify that we're able to reference all mentioned types. This ensures that we don't accidentally reference undefined classes/interfaces. Test: manual inspection of API files Bug: 69791141 Change-Id: I84e0c87fe83daa118661f61dbdf17b58ea5282d4
2017-11-16Separate android.test.mock from test-runner sourcePaul Duffin
Extracts the source for the android.test.mock library from the frameworks/base/test-runner directory into its own frameworks/base/test-mock directory. They are already treated separately at runtime and compile time so this just makes the separation complete. Bug: 30188076 Test: make checkbuild Change-Id: I20e5b06ba79677e76117c82e9f9e2ecd15e5fed6
2017-11-07Use prebuilt android.test. stubs jars for app buildsPaul Duffin
Bug: 30188076 Test: tapas Launcher3 Change-Id: If632c39c9d98d89d597d410ebc7973903c9fa91e
2017-10-24Build stubs against SDK and clear local variablesPaul Duffin
The stubs need to be built against the current SDK where possible and not the internal modules. Bug: 30188076 Test: delete stub files and remake targets Change-Id: Id724c16e56d1e8fe7f61cfafe7f11ea27e01e659
2017-09-06Fix intermittent build failures with droiddoc generated sourcesColin Cross
Jack builds fail very rarely with missing droiddoc generated source files. This happens because jack builds have an extra rule that does a quick check of the sources and touches a jack.check.timestamp file. The manual dependencies for the generated sources didn't cover this case. If the sources are partially generated when the jack.check.timestamp rule runs, the rule can see partial sources and fail. The same problem might also happen for javac builds after https://android-review.googlesource.com/c/platform/build/+/404743 separated the source list generation rule out of the $(full_classes_jar) rule. Use LOCAL_ADDITIONAL_DEPENDENCIES instead, which covers these cases and will be updated to cover future changes. Bug: 65255877 Test: m -j ANDROID_COMPILE_WITH_JACK=true out/target/common/obj/JAVA_LIBRARIES/android.test.runner.stubs_intermediates/jack.check.timestamp make sure sources are generated Change-Id: I4466b3128eb0bba6447c24abf921a6655a3d451f Merged-In: I4466b3128eb0bba6447c24abf921a6655a3d451f (cherry picked from commit 85ab406eb2abd2e98fa9a67384223592692c08a9)
2017-09-05Fix intermittent build failures with droiddoc generated sourcesColin Cross
Jack builds fail very rarely with missing droiddoc generated source files. This happens because jack builds have an extra rule that does a quick check of the sources and touches a jack.check.timestamp file. The manual dependencies for the generated sources didn't cover this case. If the sources are partially generated when the jack.check.timestamp rule runs, the rule can see partial sources and fail. The same problem might also happen for javac builds after https://android-review.googlesource.com/c/platform/build/+/404743 separated the source list generation rule out of the $(full_classes_jar) rule. Use LOCAL_ADDITIONAL_DEPENDENCIES instead, which covers these cases and will be updated to cover future changes. Bug: 65255877 Test: m -j ANDROID_COMPILE_WITH_JACK=true out/target/common/obj/JAVA_LIBRARIES/android.test.runner.stubs_intermediates/jack.check.timestamp make sure sources are generated Change-Id: I4466b3128eb0bba6447c24abf921a6655a3d451f
2017-08-11@hide new APITodd Kennedy
Change-Id: Ic9cf7ecd80dd99eb8bcfc9810f4a9fddfe8f8fe4 Fixes: 64568898 Test: None. No code change.
2017-07-31Add new API to retrieve app names in a batchTodd Kennedy
Change-Id: I57e5c132bc58a32d70007a7a105775b526ff7bb9 Fixes: 62805090 Test: cts-tradefed run commandAndExit cts-dev -m CtsContentTestCases -t android.content.pm.cts.PackageManagerTest#testGetNamesForUids_null Test: cts-tradefed run commandAndExit cts-dev -m CtsContentTestCases -t android.content.pm.cts.PackageManagerTest#testGetNamesForUids_empty Test: cts-tradefed run commandAndExit cts-dev -m CtsContentTestCases -t android.content.pm.cts.PackageManagerTest#testGetNamesForUids_valid
2017-07-17Separate android.test.mock classes from android.test.runnerPaul Duffin
The android.test.runner library contained classes in the android.test.mock. Those classes have been extracted into a separate android.test.mock library but are still part of the android.test.runner library. This change removes them from the android.test.runner library. The PackageParser change ensures that applications which specify <uses-library android:name="android.test.runner"/> still see the same set of classes at runtime as they did before this change. The logic for updating the Package to maintain backwards compatibility was extracted into its own class for a number of reasons: * PackageParser is already huge. * It is easier to test in separate class. * It reduces potential for conflicts. Bug: 30188076 Test: cts/tests/signature/runSignatureTests.sh CtsAndroidTestRunnerCurrentApiSignatureTestCases Change-Id: I19042b3f9ffff8bf0f8437db7bb8341c703e4244 Remove android.test.mock classes from android.test.runner Bug: 30188076 Test: cts/tests/signature/runSignatureTests.sh CtsAndroidTestRunnerCurrentApiSignatureTestCases Change-Id: I8ddbdb0bda7bef8858202bc085881af14d7f0c92
2017-07-05Add repackaged legacy-test and android.test.runnerPaul Duffin
The CtsSignatureTestCases test verifies that the API described in the api/current.txt file is actually available at runtime. The test class, SignatureTest, requires junit and android.test classes, some from legacy-test, some from android.test.runner which makes it impossible (without classpath scanning) for it to verify that those classes are accessible at runtime when they should be and inaccessible when they should not be which is needed for the work to remove JUnit from the Android API. This change uses jarjar to repackage the junit and android.test classes into repackaged.junit and repackaged.android.test packages in the repackaged-legacy-test and repackaged.android.test.runner modules respectively. A follow on change will switch SignatureTest over to using the repackaged classes thus allowing it to work even when junit and android.test classes are not visible. Tested by making the modules and manually verifying that they contain the classes in the repackaged package. Bug: 35192974 Bug: 30188076 Test: see above Change-Id: If0355a0d50b7540f416d464fdf7ffae0e4766b1c
2017-06-29Update android.test.runner APIPaul Duffin
Bug 62675475 changed DocLava to add some missing methods to the API definition file. This updates the API definition for the android.test.runner API. The reason this was not found when it was uploaded is because there is a discrepancy between the checkapi target and the update-api. The checkapi target will not detect that the update-api needs to make changes. This issue has been reported. Bug: 30188076 Test: make update-api && make checkapi Change-Id: I598774d3239d58eb5c58ff78e24e8ca84078e64a
2017-06-28Stubs/api check for legacy-test and android.test.runnerPaul Duffin
Adds stub generation for legacy-test classes and android.test.runner classes. Changes name of android.test.mock.sdk to android.test.mock.stubs for consistency and clarity, adds new temporary android.test.mock.sdk target to prevent build breakage. Adds api check and update targets for legacy.test.stubs, android.test.runner.stubs and android.test.mock.stubs to prevent accidental changes to the API. Bug: 30188076 Test: make checkapi and make update-api Change-Id: I40cc7b967f1ab1c7e148407d6965526550ee2f9b
2017-06-27Merge "Clean up ClassPathPackageInfoSource" am: 8c7026c5a3 am: 1c6a5ad92e ↵Paul Duffin
am: 88d54c3080 am: 06620ee22d Change-Id: I1a4de01fe23a03b42c052f23733d95e07135ab73