aboutsummaryrefslogtreecommitdiff
path: root/apex/apex_test.go
Commit message (Collapse)AuthorAgeFilesLines
...
* | Remove emptyFixtureFactory from apex and javaPaul Duffin2021-03-221-4/+2
|/ | | | | | Bug: 183235980 Test: m nothing Change-Id: I350b45e2f57430fb158f4141a566e75de17208cd
* Cleanup the now unused testCustomizerPaul Duffin2021-03-201-38/+9
| | | | | | Bug: 181070625 Test: m nothing Change-Id: I825e0da53b7fd82f4ef33d7183351c1f2ed8ee23
* Convert test specific customizers to FixturePreparersPaul Duffin2021-03-201-58/+82
| | | | | | Bug: 181070625 Test: m nothing Change-Id: I1c4b7303a1153b040b7266e95b06d172554dc52a
* Convert shared customizer functions to return FixturePreparersPaul Duffin2021-03-201-31/+33
| | | | | | Bug: 181070625 Test: m nothing Change-Id: I8d09f91a3db23eb36cd73a13e418df98949ec72d
* Allow test handlers to be either FixturePreparer or testCustomizerPaul Duffin2021-03-201-9/+21
| | | | | | | | | This allows the testCustomizers to be switched to FixturePreparers incrementally rather than in one go. Bug: 181070625 Test: m nothing Change-Id: Idd9d2e28abf9b17fc46b5566ab8d3affa330287e
* Switch testApex and related methods to use test fixturesPaul Duffin2021-03-201-155/+23
| | | | | | Bug: 181070625 Test: m nothing Change-Id: Icdd9c3d807d5497ef85946a877c6cd4b4af045bc
* Merge "Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__"Justin Yun2021-03-181-0/+34
|\
| * Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__Justin Yun2021-03-151-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | __ANDROID_VNDK__ is defined for the modules that are able to use the VNDK libraries. As both product and vendor variants define __ANDROID_VNDK__, we don't know if a module is built for vendor or product on build time. __ANDROID_VENDOR__ and __ANDROID_PRODUCT__ macros can be used to specify the image-variant-dependent codes. Bug: 180646847 Test: m nothing Change-Id: Id6c3e1e3d47deaf3684c0c02964718658cf2fec5
* | Add prebuilt_platform_compat_configPaul Duffin2021-03-171-0/+7
| | | | | | | | | | | | | | | | | | It just provides the metadata needed by the global singleton as the rest is in the apex. Bug: 182402754 Test: m nothing Change-Id: I511df7a3a06dab13ddb9ad63392ae5310dfee9c4
* | Add new compat_configs property to the apexPaul Duffin2021-03-151-1/+1
| | | | | | | | | | | | Bug: 182816033 Test: m nothing Change-Id: I485d7b178c0ed17e336a6ac2a13e8313426f374b
* | Convert TestCompatConfig test to use test fixturesPaul Duffin2021-03-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | As this test is the only test in the apex package to use the platform_compat_config module type it does not make sense to include that in all the tests so instead this converts the test to use fixtures so it can easily customize it with the additional module type. Bug: 181070625 Test: m nothing Change-Id: I56fda772ee336db6cfb677143aa28b1a18911bff
* | Merge "Don't track modules that are only available to APEXes."satayev2021-03-151-9/+3
|\ \
| * | Don't track modules that are only available to APEXes.Artur Satayev2021-03-111-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Modules that are not available for platform are developed with updatability in mind, and do not require manual approvals. Bug: 181223240 Test: checkbuild Change-Id: I10b91053b3ef5a9ff5400d9d7a68fae3144a671c
* | | Merge "Convert ...InstallHwasan.. tests to use fixtures"Paul Duffin2021-03-151-31/+21
|\ \ \
| * | | Convert ...InstallHwasan.. tests to use fixturesPaul Duffin2021-03-121-31/+21
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tests rely on changing the definition of the "libc" module which is a default module provided by the cc.GatherRequiredDepsForTest() function. That function is called from within testApexContext() and so added by default. Previously, the tests relied on a number of factors to work: 1. All the default cc modules were added to the bp contents that were passed to testApexContext(). 2. testApexContext() passed the augmented bp contents to TestArchConfig(). 3. TestArchConfig() only stored the supplied bp contents in the root Android.bp file if it did not exist. So, in order to override the default modules it simply made sure to add its own Android.bp file into the file system first. Unfortunately, that does not work with the test fixtures as the default modules are defined in their own specific paths to avoid conflicting with each other. To achieve the same effect as previously, i.e. no default modules, this test uses an emptyFixtureFactory and only adds preparers for cc and apex build components and ignores the default module definitions altogether. Bug: 181070625 Test: m nothing Change-Id: Ic6b961dd2bd78c32cb326b2c7905426ee971c2d8
* | | Merge "Treat core_platform as stable unless module uses legacy"Nicolas Geoffray2021-03-151-3/+6
|\ \ \ | |/ / |/| |
| * | Treat core_platform as stable unless module uses legacyPaul Duffin2021-03-101-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sdk_version: "core_platform" refers to the stable core platform unless the module is in the exception list. This change makes sure that CheckStableSdkVersion() reflects that behavior. Bug: 180399951 Test: m nothing Change-Id: Ia0b1e13322352b87f5a3c6621e37f23ba637ffb6
* | | Add apexFixtureFactory to apex packagePaul Duffin2021-03-111-0/+88
| |/ |/| | | | | | | | | | | | | | | | | | | Unlike the similar changes in other packages this change separates the addition of the fixture factory and the conversion of the test... methods to use them as there are a few tests that need converting to use test fixtures first. Bug: 181070625 Test: m nothing Change-Id: Ic76523ba89fc1967631aeb682935935b5af116df
* | Merge "Extract apex registration code into function for reuse"Paul Duffin2021-03-101-12/+2
|\ \ | |/ |/|
| * Extract apex registration code into function for reusePaul Duffin2021-03-091-12/+2
| | | | | | | | | | Test: m nothing Change-Id: Id2c918891ecd9e874004f6828f71374bf0cdb9e4
* | Run "prebuilt_postdeps" mutator againJooyung Han2021-03-091-2/+1
|/ | | | | | | | | | | | | | | | Because OverridablePropertiesDepsMutator is run after prebuilt_postdeps, prebuilt's replacement doesn't affect to those deps added by overridable properties. By running prebuilt_postdeps again after OverridablePropertiesDepsMutator, replacing source with prebuilts is applied to those deps. Bug: 152155285 Bug: 181953909 Bug: 181974714 Test: m nothing Change-Id: I24acc02785c9580c2beca096042f1173eb28ba9a
* Merge "Remove extra return value from testApex"Colin Cross2021-03-081-98/+98
|\
| * Remove extra return value from testApexColin Cross2021-02-191-98/+98
| | | | | | | | | | | | | | The config value returned by testApex is no longer used, remove it. Test: go test ./apex Change-Id: I9327c1b139c17305454fb0a111e41456cdcaebc3
* | Fix mutator ordering issue in apex testsPaul Duffin2021-03-051-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the override mutators were being run before the prebuilt mutators that did not match the runtime behavior. This change fixes that ordering. In the process it broke TestApexWithAppImportsPrefer. That test tries to verify that an apex that depends on an android_app will use an android_app_import if that is preferred. Unfortunately, it only worked because of the incorrect order of the mutators. The test worked before this change because the prebuilt mutators were being run after the overridableModuleDepsMutator. That meant that any dependencies added by that mutator onto source modules could be replaced by the PrebuiltPostDepsMutator with the preferred prebuilt module. Switching the order to match the runtime meant that the prebuilt mutators were run before the overrides so never had a chance to replace the dependencies added by the overrides. Bug: 181953909 Bug: 181974714 Test: m nothing Change-Id: Ic98fdc29a63155174a3227e7e918b26f0a8763bb
* | Merge "Friendly error message on apex_available and min_sdk_version checks"Treehugger Robot2021-03-051-1/+1
|\ \
| * | Friendly error message on apex_available and min_sdk_version checksJiyong Park2021-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) suggest a fix at the end of the message 2) add new lines around the dependency path so that they are visually separated from rest of the error message Bug: N/A Test: m with an intentional break error: bionic/apex/Android.bp:32:1: module "com.android.runtime" variant "android_common_com.android.runtime_image": "libutils_headers" requires "libsystem_headers" that doesn't list the APEX under 'apex_available'. Dependency path: via tag apex.dependencyTag: { name:executable payload:true} -> crash_dump{os:android,image:,arch:arm_armv8-a,sdk:,apex:apex10000} via tag cc.libraryDependencyTag: { Kind:staticLibraryDependency Order:normalLibraryDependency wholeStatic:false reexportFlags:false explicitlyVersioned:false dataLib:false ndk:false staticUnwinder:false makeSuffix: skipApexAllowedDependenciesCheck:false excludeInApex:false} -> libtombstoned_client_static{os:android,image:,arch:arm_armv8-a,sdk:,link:static,apex:apex10000} via tag cc.libraryDependencyTag: { Kind:staticLibraryDependency Order:normalLibraryDependency wholeStatic:true reexportFlags:true explicitlyVersioned:false dataLib:false ndk:false staticUnwinder:false makeSuffix: skipApexAllowedDependenciesCheck:false excludeInApex:false} -> libcutils{os:android,image:,arch:arm_armv8-a,sdk:,link:static,asan:,apex:apex10000} via tag cc.libraryDependencyTag: { Kind:headerLibraryDependency Order:normalLibraryDependency wholeStatic:false reexportFlags:false explicitlyVersioned:false dataLib:false ndk:false staticUnwinder:false makeSuffix: skipApexAllowedDependenciesCheck:false excludeInApex:false} -> libutils_headers{os:android,image:,arch:arm_armv8-a,sdk:,asan:,apex:apex10000} via tag cc.libraryDependencyTag: { Kind:headerLibraryDependency Order:normalLibraryDependency wholeStatic:false reexportFlags:true explicitlyVersioned:false dataLib:false ndk:false staticUnwinder:false makeSuffix: skipApexAllowedDependenciesCheck:false excludeInApex:false} -> libsystem_headers{os:android,image:,arch:arm_armv8-a,sdk:,asan:,apex:apex10000} Consider adding "com.android.runtime" to 'apex_available' property of "libsystem_headers" Change-Id: I09f92c3086ea433780133a33ba0ad73baee6dc41
* | | Merge "cd to / before running soong_build ."Lukács T. Berki2021-03-041-1/+2
|\ \ \
| * | | cd to / before running soong_build .Lukacs T. Berki2021-03-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lets one avoid any decisions as to when to chdir there during its execution and leads to better sandboxing because the pwd doesn't leak to init() functions anymore. Test: Manual. Change-Id: I1560da8ed3a621249426f9e8908aa890c21e13ba
* | | | Make apex.updatable default to true.Mathew Inwood2021-03-031-0/+120
|/ / / | | | | | | | | | | | | | | | | | | | | | Update tests accordingly and add a new test case for this. Bug: 180375550 Test: Treehugger Change-Id: I835e189f4dae1e4bc79dce7bc59b7b9c7bd19fd9
* | | Merge changes I3e6bc9b5,If9f8fb10Colin Cross2021-03-031-96/+49
|\ \ \ | | | | | | | | | | | | | | | | | | | | * changes: Disable TestSendLog on the buildbots Remove global state from VNDK apexes
| * | | Remove global state from VNDK apexesColin Cross2021-03-021-96/+49
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Use the name of the apex instead of a global map to find the right VNDK apex for each VNDK version. Bug: 181689854 Test: apex tests Change-Id: If9f8fb10d09e125c9e7d44228e1aa746bf53c082
* | | Merge "Verify the prebuilt_apex selects the correct input apex file"Paul Duffin2021-03-021-0/+7
|\ \ \
| * | | Verify the prebuilt_apex selects the correct input apex filePaul Duffin2021-03-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will ensure that the following refactoring does not change the behavior. Bug: 181267622 Test: m nothing Change-Id: Ieb9b37c2a1ef609b2d6565c54c261439a1ce7147
* | | | Merge "Add test to verify the deapexer rule's input apex file"Paul Duffin2021-03-021-0/+7
|\| | |
| * | | Add test to verify the deapexer rule's input apex filePaul Duffin2021-03-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will ensure that the following refactoring does not change the behavior. Bug: 181267622 Test: m nothing Change-Id: I36ae9ec9a0a7977bd394f4100c72941052d763ac
* | | | Merge "APEX uses the latest version of the stub"Treehugger Robot2021-03-021-52/+17
|\ \ \ \ | |/ / / |/| | |
| * | | APEX uses the latest version of the stubJiyong Park2021-03-011-52/+17
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously when an APEX whose min_sdk_version is set is linked to an external library providing multiple versions of stubs, the maximum version that is less than or equal to the min_sdk_version was chosen. For example, if the versions of a library stubs are 28, 29, 30, and 31, then APEX with min_sdk_version: 29 linked to the version 29 of the stub. This was to ensure that the APEX doesn't use any new APIs whose existence can't be guaranteed. This however imposes a severe restriction that the APEX can never use new APIs even when the APIs are actually available: i.e. when the APEX is running on a newer platform. With the recent work about unguarded availability, using the future APIs became much safer. When you use an API that is newer than your min_sdk_version, the API is automatically declared as a weak symbol (thus no link error at runtime), while the call to API is guaranteed to be guarded with the `__builtin_available(...)` macro. So, there really is no reason to use the old version of the stub. We can always use the latest version of stub safely. Bug: N/A Test: m Change-Id: Iaac0d8761d8929154527dc2e861a51ae31e23d49
* | | Allow java_sdk_library_import to contribute to hiddenapi processingPaul Duffin2021-03-011-13/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Invokes hiddenAPIExtractInformation() on the java_sdk_library_import's dex implementation jar provided by the deapexer (on behalf of prebuilt_apex) so that hiddenAPI can extract the information it needs, if anything, from the dex file. The dex file provided by deapexer has already had the hiddenapi information encoded into it so it does not need to do that again. Usually, it would require a classes implementation jar as well in order to extract information from UnsupportedAppUsage annotations but that is not available for a java_sdk_library_import. Fortunately, the modules that are currently affected by this do not contain any such annotations. This just uses a public api stubs jar instead. Bug: 181267622 Test: m nothing Change-Id: I96275e46f8b7fecba88075319e9f2da5ae315c03
* | | Retrieve dex implementation jars from apex for java_sdk_library_importPaul Duffin2021-03-011-8/+55
|/ / | | | | | | | | | | Bug: 181267622 Test: m nothing Change-Id: Idd6af2482f48bd3a05db88b8a06dbbbdee01ef78
* | Merge "Add ctx to AndroidMkExtraEntriesFunc"Treehugger Robot2021-02-221-33/+33
|\|
| * Add ctx to AndroidMkExtraEntriesFuncColin Cross2021-02-191-33/+33
| | | | | | | | | | | | | | | | | | Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to access providers. Test: m checkbuild Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc Merged-In: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
* | Linktype check error message becomes more correctJiyong Park2021-02-181-1/+1
| | | | | | | | | | | | | | | | | | The type linkType has String() method and the error message is created using it. Bug: 180477804 Test: m nothing Change-Id: I74fe9c93b74904177dbe9d29cd3aa3304b67ba4f
* | Convert java.Dependency to JavaInfo providerColin Cross2021-02-091-1/+1
|/ | | | | | | | | Export information about java dependencies through a Provider instead of accessing the module directly. Test: java_test.go Test: no changes to build.ninja Change-Id: Ifc5d566bf6f6ebc0ad399e948effaa1ef6a22876
* Allow dex jars from prebuilt_apex to be used by hiddenapiPaul Duffin2021-02-081-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Invokes hiddenAPIExtractInformation() on the dex jar provided by the deapexer (on behalf of prebuilt_apex) so that hiddenAPI can extract the information it needs, if anything, from the dex file (and accompanying classes implementation file). The dex file provided by deapexer has already had the hiddenapi information encoded into it so it does not need to do that again. This change adds the primary parameter to hiddenAPIExtractInformation() and checks it (and also the hiddenAPI.active property) before it does anything. That ensures that it behaves correctly when called directly as well as when called from hiddenAPIExtractAndEncode(). Bug: 178361284 Test: m droid Verified that hiddenapi files (both aggregated ones and for the individual modules) are not affected by this change. Also verified that the hiddenapi files created when using the prebuilts (using SOONG_CONFIG_art_module_source_build=false) are the same as when using the source. There is a slight difference in the order but otherwise identical. Change-Id: I7abb63fd310bb94787ab7f4821e5fd283dc03046
* Refactor the hiddenAPI() method for reusabilityPaul Duffin2021-02-081-1/+24
| | | | | | | | | | | | | | A follow up change needs to be able to contribute to the information the hiddenapi process collates without having a dex file encoded. This change pushes all the functionality related to information gathering into the hiddenAPIGenerateCSV() method and then renames it and the hiddenAPI() method to make it clearer what they do. Bug: 178361284 Test: m droid Verified that hiddenapi files (both aggregated ones and for the individual modules) are not affected by this change. Change-Id: I04417720216a0fbadcd88e6185e7de6570af6216
* Integrate hiddenapi processing into boot jars testPaul Duffin2021-02-071-1/+7
| | | | | | | | | | | | | | | | | | | This change registers the hiddenapi singleton so that hiddenapi processing is performed as part of TestBootDexJarsFromSourcesAndPrebuilts so that additional hiddenapi related tests can be added later. The hiddenapi singleton uses the BootJars/UpdatableBootJars properties from productVariables not the dexpreopt.GlobalConfig so this change makes sure that they are consistent. Performing hiddenapi processing causes the dex file used in "prebuilt with source apex preferred" test to be encoded with hiddenapi information which changes the path in the test. Bug: 178361284 Test: m nothing Change-Id: I2eb3d8cf11f6fb3bf4a34d6e4ae0c397c890191e
* Ensure subtest failures are reported on subtestPaul Duffin2021-02-071-12/+12
| | | | | | | | | | | | | | | A subtest (code inside the func passed to t.Run(...)) are passed their own t *Testing pointer to use to report errors in order to ensure that they are treated as errors of the subtest and not the containing test. This change ensures that the subtests in the following tests use the correct t *Testing. * TestPrebuiltExportDexImplementationJars * TestBootDexJarsFromSourcesAndPrebuilts Bug: 178361284 Test: m nothing Change-Id: I4e8b166051cb6098c89d8e68a450c81a714f7677
* cc: fix version macro for stubsJooyung Han2021-02-051-0/+74
| | | | | | | | | | | | | | When a cc module is built against a stub, compiler passes version macro of the stub lib. Version macro should be numeric, so codenames or "current" should be mapped to numbers just like how ndkstubgen maps to. * "current" -> future (10000) * codenames -> look up api_level.json * otherwise -> cast to int Bug: 179329813 Test: m / soong test / manually check the output build.ninja Change-Id: Ic0e1dd904984e161694a0b77fad5559c06a4462f
* Merge "Fix boot jar handling when both source and prebuilt APEXes and ↵Martin Stjernholm2021-01-291-1/+211
|\ | | | | | | modules are present."
| * Fix boot jar handling when both source and prebuilt APEXes and modulesMartin Stjernholm2021-01-281-1/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | are present. 1) The boot jar to APEX mapping is maintained by the base names for both of them. When building with prebuilt modules and APEXes, that means we need to take care to compare them without regard to any "prebuilt_" prefixes. 2) VisitAllModules can visit disabled modules and both source and prebuilt modules, so they need some conditions to skip modules that aren't applicable for boot jars. Test: `m droid` Test: `m droid SOONG_CONFIG_art_module_source_build=false` with fresh ART Module prebuilts in place Bug: 171061220 Change-Id: Iced269d29127bc8b8f9b3171adb60a97d115628b