summaryrefslogtreecommitdiff
path: root/legacy-test
AgeCommit message (Collapse)Author
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-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-14Merge "Stop using c.a.i.u.Predicate outside test-runner" am: ee2fb3c59e am: ↵Paul Duffin
847df2cafc am: 3b24847d39 Change-Id: Ibc581c8ce0f859d17dd387e29e37fba6184b3488
2017-11-14Merge "Stop using c.a.i.u.Predicate outside test-runner" am: ee2fb3c59ePaul Duffin
am: 847df2cafc Change-Id: I3d5f64b3551df8d5b3af1a18dfd63147fa186df7
2017-11-14Stop using c.a.i.u.Predicate outside test-runnerPaul Duffin
This class has been deprecated and should only be used in the frameworks/base/test-runner directory. Bug: 30188076 Test: make checkbuild Change-Id: I61059a96aa6045c44546239b94b329c02bb745a1
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-07-13Repackage com.android.internal.util.PredicatePaul Duffin
Needed to avoid conflict with com.android.internal.util.Predicate currently provided by the runtime. Bug: 35192974 Test: check generated dex file Change-Id: Ibcafe1ea362e85acee8d1eeb21e432a3c47eb009
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-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-22Clean up Predicate related code in android.testPaul Duffin
Part of the work of removing JUnit and dependent android.test classes from the Android API involves providing a static library that developers can include in their test applications to ease migration. That library will be built directly from the source (as opposed to android.jar which is built from stubs) and so developers will be able to see classes and methods that are not present in the stubs. This change is one of a number of similar changes that cleanup the existing non-API code in order to minimize the additional methods and classes exposed externally. The basic approach is to remove unused classes and methods, use least visible access modifier possible and generally minimize the amount of publicly visible code. The HasClassAnnotation and HasMethodAnnotation were never used separately and only used by HasAnnotation. This merges the functionality into a single nested class in TestPredicates, hidden behind the new TestPredicates.hasAnnotation(). The HasAnnotationTest was renamed as TestPredicatesTest and the HasClassAnnotationTest and HasMethodAnnotationTest classes were removed as their tests provide no additional coverage. The removal of the Has*Annotation.java files means that the test-runner/src/android/test/suitebuilder/annotation/ directory is empty apart from the package.html file so that was moved to legacy-test to sit alongside the actual annotation classes. The Predicates class, while part of the legacy-test module was only ever used by the test-runner module and only its not() method was actually used. So, the not() method and associated nested class were moved to TestPredicates, the tests for not() were moved to TestPredicatesTest and the Predicates* classes were removed. That allowed for the removal of the legacy-android-tests as that is now empty. TestPredicates has a number of constants that were public. They were hidden by moving them to the class that actually used them. A minor generic issue was fixed in AssignableFrom. Bug: 30188076 Test: make checkbuild and run FrameworkTestRunnerTests Change-Id: I861da388a4146bb28e1e480d1b7ba9137b7b270e
2017-05-12Moved c.a.i.u.Predicate[s] into legacy-testPaul Duffin
These classes are only used by android.test classes that are being removed. As their name suggests they should not be in the Android API at all so it makes sense to remove them. Especially as there is java.lang.function.Predicate available now. It appears as though Predicate was only added in to the API because it was used by a method in the API as the directory in which it and Predicates live was not on the list of classes to explicitly index. Moving it into legacy-test meant that they are now being indexed explicitly which means that Predicates needs to be hidden. Keeps running the tests as part of the existing target. At runtime apps targeted at the API version before these are removed will have the legacy-test library automatically added to their classpath so they should see no effect. Apps that target a later API will have to include those classes from the android.legacy.test.jar which will contain all the android.test classes that depend on it as well. Bug: 30188076 Test: make checkbuild Change-Id: I6f6f5f16fe93bd80227a450c6254166632fc6813
2017-05-09Statically include android.test.runner classes in legacy-android-testPaul Duffin
In preparation for removing junit and android.test classes from the Android API this change adds the android.test classes that are in the android.test.runner library into legacy-android-test so that they can be statically included into the application. The junit.... classes from android.test.runner can already be statically included from the junit library. Bug: 30188076 Test: make checkbuild Change-Id: Id8d32da9e46f0d9142b60ef28998b40e8d237b32
2017-02-22Fix build failure when using javac toolchainPaul Duffin
The legacy-performance-test-hostdex library was built using the BUILD_HOST_DALVIK_JAVA_LIBRARY macro (which creates a non-static library) but is used with LOCAL_STATIC_JAVA_LIBRARIES which requires a static library. That works with Jack but fails with the javac toolchain. This change switched to build legacy-performance-test-hostdex using the BUILD_HOST_DALVIK_STATIC_JAVA_LIBRARY macro. Bug: 30188076 Test: make checkbuild Change-Id: I8d42c669e4ded3417ecdcb7b0251bc6346debd5d
2017-01-17Add legacy-android-test target containing android.test classesPaul Duffin
In preparation for removing junit classes from the Android API the legacy-test target will be removed from the TARGET_DEFAULT_JAVA_LIBRARIES. This change adds a legacy-android-test target, containing only the android.test classes, for use by any targets that depend on those classes. Bug: 30188076 Test: make checkbuild Change-Id: Ifc0a9a23d4ac3c78428bb9dde38e547e6978ba7e
2016-12-14Copy core-junit files into legacy-test.Paul Duffin
The legacy-test directory contains part of the Android API and so must maintain backwards compatibility. The junit classes that are in the API are copied here to ensure that they do not change when external/junit is upgraded. Bug: 30188076 Test: make checkbuild and checked legacy-test contents Change-Id: I6c263afc16c06abfd027334be51a41422239a189
2016-12-08Move android.test classes from core/java to legacy-test/srcPaul Duffin
(cherry picked from 2395179afb2ea957a9ba66404021c14160361611) Bug: 30188076 Test: make checkbuild Merged-In: Ifa291909fcf47da788627b496bd72f54efd78ed7 Change-Id: Ie20dceb9f89df245ed6da5fc2fb06185bd7b104b
2016-12-07Add legacy-performance-test-hostdex targetPaul Duffin
This is needed for some internal targets that currently depend directly on the source files and which break when the source file is moved. Bug: 30188076 Test: make legacy-performance-test-hostdex Change-Id: I653325605204c1f272bd5f669e2297eedeaf7d61
2016-11-29Add legacy-test as replacement for core-junitPaul Duffin
Statically includes core-junit-static into legacy-test target so that legacy-test can be used in place of core-test. Once that switch over has been done then android.test classes that are being removed from the public API can be safely moved into here. Bug: 30188076 Test: make legacy-test and check contents of generated legacy-test artifacts Change-Id: I75488303067c4ac34c46279bfce9a51273adcc34