summaryrefslogtreecommitdiff
path: root/sysprop/sysprop_test.go
AgeCommit message (Collapse)Author
2025-02-20Remove RELEASE_USE_TRANSITIVE_JARS_IN_CLASSPATH Colin Cross
RELEASE_USE_TRANSITIVE_JARS_IN_CLASSPATH is set to true in all release configs in main, Soong can stop checking the value. This implicitly enables the flag for all of the tests in Soong, which requires updating paths in many of them. Test: builds Change-Id: I2e0d6cd109e1aa7a1163116fa1210e3f42f57878
2025-02-12Don't panic in ModuleForTests and friends Colin Cross
Panicking in ModuleForTests and similar test helper functions was a mistake. Go's test runner stops running tests as soon as any test panics, which means debugging multiple tests panicking requires rerunning all the tests after fixing each panic to find the next one. Pass the *testing.T into ModuleForTests and friends so that it can call t.Fatalf instead. Test: all soong tests pass Change-Id: I5d0f2424eaf04fb795079e6d1e4b9469d8c7033c
2024-04-01Remove VNDK information from Rust, etc, and sysprop tests Kiyoung Kim
VNDK is deprecated in 24Q2, so soong should be tested with no device and platform vndk versions. This change removes all VNDK related tests and VNDK versions from soong-etc, soong-rust and soong-sysprop tests. Bug: 330100430 Test: m nothing --no-skip-soong-tests passed Change-Id: Ie34d23f0facab31078de54682f7cc78d37fcd4be
2024-03-18Generate wrapper lib.rs with one module per sysprop file. Andrew Walbran
This required moving to a SourceProvider for the Rust library. With the previous approach only the first input file was being used. Bug: 270547306 Test: Built libplatformproperties_rust, looked at output Change-Id: I1070655abc071e099a42bc4be61cc080902e31c1
2024-02-21Revert^4 "Integrate Rust-specific System Properties into rules generation." Andrew Walbran
This reverts commit 2766baa922343f12529d5f780cffc6ea831cbf83. Reason for revert: Relanding after fix in I3b190ebc1a1096972d0a1273e490972e04684dd2 Change-Id: Ie34301c506d3469ec3306f433631b0842b66d032
2024-02-15Merge "Revert^3 "Integrate Rust-specific System Properties into rules ↵ Paul Duffin
generation."" into main
2024-02-15Revert^3 "Integrate Rust-specific System Properties into rules generation." Paul Duffin
This reverts commit ac0c87311d6671cf442120ff56e24c40418de441. Reason for revert: breaking the same bug, b/323833345 as before Change-Id: I474c032148f22c4b98f7adf23be61807fa0500a0
2024-02-15Merge "Revert^2 "Integrate Rust-specific System Properties into rules ↵ Andrew Walbran
generation."" into main
2024-02-14Revert^2 "Integrate Rust-specific System Properties into rules generation." Andrew Walbran
This reverts commit be3ea4f149c8688a8b76c4587a4c5f6813d567c1. Reason for revert: Reland Change-Id: Ic003c52a1477da9a6a70b82e4d4ae4a55edc584f
2024-02-05Merge "Revert "Integrate Rust-specific System Properties into rules ↵ Rico Wind
generation."" into main
2024-02-05Revert "Integrate Rust-specific System Properties into rules generation." Rico Wind
This reverts commit 65374edd0e25e76b38933c76c95cf03069955ef2. Reason for revert: b/323833345 Change-Id: Ia722b68923617b4abfe3fd96b54b3fe108e9de74
2024-02-05Merge "Integrate Rust-specific System Properties into rules generation." ↵ Andrew Walbran
into main
2024-01-04Revert "Revert "Limit System SDK to 34 for Java modules in the v..." Jiyong Park
Revert submission 2897568-revert-2894701-limit_systemsdk-WNEMOTGMRS Reason for revert: Forward fix was merged Reverted changes: /q/submissionid:2897568-revert-2894701-limit_systemsdk-WNEMOTGMRS Change-Id: Id857406513fbf33a20e5d3836742ebd8a0105516
2024-01-04Revert "Limit System SDK to 34 for Java modules in the vendor pa..." Sebastian Pickl
Revert submission 2894701-limit_systemsdk Reason for revert: might be breaking builds at 318695834 Bug: 318695834 Reverted changes: /q/submissionid:2894701-limit_systemsdk Change-Id: I71a87d0a026a444ea9d26f889b3421162e13fea9
2024-01-04Limit System SDK to 34 for Java modules in the vendor partition Jiyong Park
This change disallows Java modules in the vendor partition to use System SDK that is newer than API level 34; 34 is the latest allowed. Background 1: with Trunk Stable, the system/vendor interface is released at Q2 whereas the system/app interface is released at Q3. In other words, at Q2, the APIs which will be added to the system SDK at Q3 are not available. Since the system/vendor interface (which is fronzen at Q2) is what the modules in the vendor partition will be building against, they can't and shouldn't use those new APIs that will be added in the future (Q3). Using those APIs is risky because there's a chance that those APIs get removed or changed between Q2 and Q3. For example, 2024 Q2 is technically still Android U, not Android V. Background 2: The use of Java APIs in the vendor partition had many issues. Most significantly, those "vendor" Java apps are categorized as part of the system partition because all Java app processes require access to platform internal libraries that are prohibited to vendor processes. Furthermore, since the Project Treble, the vendor partition was re-purposed to a partition to host SoC-dependent bits - usually HALs. Implementing HALs in Java has never been officially supported and has had many loop holes. We'd like to use both background 1 and 2 as a chance to disallow any Java code in the vendor partition. However, since there are already some Java modules in the partition, we can't suddenly ban it. The deprecation will be made gradually, and this CL is the start. Note that sdk_version: "current" or "system_current" is automatically overridden into 34 or system_34. This is to prevent sudden breakage of vendor modules that have been targetting the latest (i.e. current) API level. They will however fail if they use APIs newer than API level 34. Bug: 314011075 Test: m blueprint_tests Change-Id: I59f5ac15ce9ac2ff7cc89e9c110169359077c37c
2023-09-27Generate product variants by default Justin Yun
PRODUCT_PRODUCT_VNDK_VERSION is set to 'current' by default. Now, we can generate product variants without checking the PRODUCT_PRODUCT_VNDK_VERSION build variable. Remove reading the PRODUCT_PRODUCT_VNDK_VERSION variable from soong and generate product variants by default. Bug: 302255959 Test: m Change-Id: I9a9b2076f4367c5ce9a393bbb206f8dee3884bd8
2023-09-11Integrate Rust-specific System Properties into rules generation. Dzmitry Shmatkou
Bug: 270547306 Test: Build rust-specific System Properties rules to check the generated code. Change-Id: I3d102f96f3b676cde576d270c5090c1707ec1dd7
2022-09-15Delete SyspropMutator (again) Trevor Radcliffe
This CL essentially un-reverts aosp/2119952, now that the issue has been resolved. Bug: 226199990 Test: m Change-Id: I3b828eb7f7cf54023c9e1d3229cf1ff7c85ab6dd
2022-09-14Revert "Delete SyspropMutator" Chung-Kai (Michael) Mei
This reverts commit 2db49e32695470be11a3d12b10890aa39700dbb2. Reason for revert: Break aosp build on git_tm-dev-plus-aosp and downstream branches Change-Id: I0a86bf5e1e1f2ddf71308250f9110a9608ac2d8d Bug: 246355583
2022-08-15Delete SyspropMutator Trevor Radcliffe
This CL and its associated CLs point cc modules that rely on sysprop_library modules to the auto-generated cc_library module, and then remove the code in Soong which maps the sysprop_library target to the generated target. This is being done because Bazel will not be supporting the existing behavior in Soong. Bug: 226199990 Test: m Change-Id: I117c5a4a9bf7c38e6fb7b92272a390df87507e30
2022-04-11Move proguard test files to java package Colin Cross
The proguard test files are duplicated in apex and sysprop and will be needed by app tests, move them to the java package. Test: run all soong tests Change-Id: Ie13817dcda8d98801d16a97ffceef1100c7d5380
2021-04-26Remove obsolete llndk_library Colin Cross
Remove llndk_library in favor of cc_library with llndk.symbol_file. Bug: 170784825 Test: m checkbuild Test: TestLlndkLibrary Change-Id: I43580976589a7a2a176d7442be53fa043c0c8324
2021-04-05Don't use incorrect version names like VER or BOARD even in tests Jiyong Park
All version names will go through ApiLevelFromUser which triggers an error when the name is not a valid one. Bug: 175678607 Test: m Change-Id: Id33bf64085603914d45ad7942cb8908a4734493f
2021-04-03Move java.sdkSpec to the android package Jiyong Park
... in preparation for making the handling of sdk versions consistent across java and cc modules. Bug: 175678607 Test: m Change-Id: I598f0454bce9b7320621022115412fbe97403945
2021-03-22Remove usages of FixtureFactory from misc packages Paul Duffin
These packages have already been migrated to use per test build directory so have no need for a FixtureFactory. Bug: 183235980 Test: m nothing Change-Id: I667d1d992caaf0f615de91f89efdae11c44986c2
2021-03-18Convert sysprop package to fixtures Paul Duffin
Bug: 182885307 Test: m nothing Change-Id: I2e69e7b5eb3bad579df39c9dd49f2d670881a265
2021-03-08sysprop_library correctly supports apex_available and min_sdk_version Jiyong Park
This fixes a bug that apex_available and min_sdk_version properties of a sysprop_library module are not forwarded to the generated cc or java modules. Bug: 181942475 Bug: 181940232 Test: m nothing Change-Id: I03bcb5836f080aecd452021a3ffe003f36eb652e
2021-02-26Remove global state from sysprop libraries Colin Cross
Sysprop libraries use a global list to rewrite dependencies from implementation libraries to public stub libraries when appropriate. Remove the global list, and instead add a dependency from the implementation to the public stub that forwards the JavaInfo. Bug: 181367697 Test: sysprop_test.go Change-Id: Ia7995feb3c079ca9bb6a403daaae3e3329fd7f6a
2021-01-21Add java.RegisterRequiredBuildComponentsForTest function Paul Duffin
Insulate tests that exercise code in the java package from having to register the build components provided by the java package by providing a single function that registers them all. This follows the pattern currently used in the cc and rust packages. This change is in preparation for switching the dex_bootjars singleton from a singleton, which does not require a module definition in order to be instantiated, to a singleton module which does. That will require adding a module definition into java.GatherRequiredDepsForTest() and this change ensures that the required components will have been registered in every test. Bug: 177892522 Test: m nothing Change-Id: I6475db8240894947dd07c89a940a3e4f201aa598
2020-11-12Pass Config to NewTestContext instead of ctx.Register Colin Cross
Prepare for using Config when adding singletons by passing Config to NewTestContext and NewContext instead of to ctx.Register. This will enable a followup change to store SingletonMakeVarsProviders registered on the Context in the Config, which is necessary to run multiple tests in parallel without data races. Test: all soong tests Change-Id: Id229629a4e42ff4487d317241673837726c075fc
2020-10-23Merge "Add llndk_stubs property" Colin Cross
2020-10-21Add llndk_stubs property Colin Cross
Prepare for making the relationship between an llndk_library stubs module and the cc_library implementation module explicit by adding an llndk_stubs property. Each cc_library will be updated to point to its llndk_library, and the llndk_library name will be changed to make the .llndk suffix explicit. Then the implicit connection and suffix can be removed. Bug: 170784825 Test: m checkbuild Change-Id: I6b0482a3f286ec29b2e928551aa4317749f2b499
2020-10-20Use sysprop stub regarding to the install location Inseob Kim
Rather than the owner of sysprop, the install location is important when choosing a stub for sysprop_library. Bug: 171170584 Test: soong test Change-Id: Iba934d14dd235bd85d0bd631ef6bad83c1b4f551
2020-10-09Revert "Make lots of tests run in parallel" Colin Cross
This reverts commit 323dc60712491c71ccdc5363c42df61f0a192487. Reason for revert: Possible cause of test instability Bug: 170513220 Test: soong tests Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
2020-10-06Make lots of tests run in parallel Colin Cross
Putting t.Parallel() in each test makes them run in parallel. Additional t.Parallel() could be added to each subtest, although that requires making a local copy of the loop variable for table driven tests. Test: m checkbuild Change-Id: I5d9869ead441093f4d7c5757f2447385333a95a4
2020-07-31Fix prebuilt mutator ordering in tests Paul Duffin
Previously, the prebuilt mutators were added by the cc.RegisterRequiredBuildComponentsForTest() function as a convenience but unfortunately it lead to some of the mutators being in a different order in the tests than in the normal build. This change: * Extracts the RegisterPrebuiltMutators() call from cc.RegisterRequiredBuildComponentsForTest() * Makes sure that the prebuilt mutators are registered before the visibility gatherer and enforcer mutators. Bug: 162505935 Test: m nothing Change-Id: I7d959b558200b502f0a5e4653c41ea01414e142a
2020-03-30Add apex_available to sysprop_library Paul Duffin
Added apex_available support to sysprop_library and copied it onto the underlying cc_library. Bug: 152762638 Test: m nothing Change-Id: I8f4c539532b48f3a45c1fbf0f7287db11df69d2f
2020-02-20Add C++ Host support on sysprop_library Inseob Kim
With Host_supported: true, C++ part of sysprop_library will create host variant which can be used from host modules. As there are no native system property support on host, libbase functions will be used instead. Adding support on host will help reduce code complexity of other host_supported modules. Bug: 147708854 Test: m, sysprop_test, manually test host binary Change-Id: I850d91fea298ef1a0c16c6a7a9ec1aca5cf37e69
2019-12-20Dedup cc library module type registration Paul Duffin
Test: m checkbuild Bug: 146540677 Change-Id: I6685338550f587212e70f3eba8d4342b66f566e2
2019-12-19Improve cc tests by adding sanitizer mutators Paul Duffin
This fixes an issue that arises when deduping cc build component registration code. The sanitize_runtime_deps and sanitize_runtime post deps mutators were not previously added when running cc tests. That meant the tests were not actually testing the same behavior as at runtime. Adding the mutators breaks the TestFuzzTarget test as the mutator adds libclang_rt.ubsan_standalone-aarch64-android as a dependency of libc++ and the former is not available. This fixes the test by adding the missing dependency as a cc prebuilt shared library. Test: m checkbuild Bug: 146540677 Change-Id: Ie13c7e6fcefef7d9cb1cc5364be3dc563ce40de5
2019-12-19Dedup prebuilt mutator registration Paul Duffin
Test: m checkbuild Bug: 146540677 Change-Id: I9f8a11adf61fe6f352ec1eabc7c5bac332348ba2
2019-12-19Dedup registration for cc default test config Paul Duffin
The cc.GatherRequiredDepsForTest() method returns some default module definitions that are required when using cc module types like cc_library. Previously, the registration of the module types and mutators needed to process those default definitions was duplicated in the test config initialization. This change removes that duplicated code and replaces it with calls to cc.RegisterRequiredBuildComponentsForTest(ctx) which registers all the required build components. Test: m checkbuild Bug: 146540677 Change-Id: I80b6913c5691ff164ce9d308b9e1da24940f2d42
2019-12-19Dedup system modules and sdk library module type registration Paul Duffin
Test: m checkbuild Bug: 146540677 Change-Id: I982fcb8d723e8e2f7679434051ddc427d4fbd7be
2019-12-19Dedup registration code for module types and singletons Paul Duffin
The registration of module types and singletons is duplicated between init() functions that register them for use in the build runtime and test context creation code that registers them for testing. This is a proof of concept for a mechanism that will allow the code to be shared. It defines a RegistrationContext interface that is implemented by both the TestContext and the new initRegistrationContext type. An instance of the the latter is available through the InitRegistrationContext variable. The intent is that the registration of the module types and singleton types will be extracted from the init() function into a separate function that takes a RegistrationContext parameter. That method is called from init() passing in the InitRegistrationContext and from a test passing in the TestContext. Something like this: func init() { RegisterBuildComponents(android.InitRegistrationContext) } func RegisterBuildComponents(ctx android.RegistrationContext) { ctx.RegisterModuleType(....) .... } A test would do something like this: ctx := android.NewTestContext() RegisterBuildComponents(ctx) Test: m nothing Change-Id: I97173cabb6d6cf7ce98fdb5f73418438b1997b35
2019-12-19Merge "Create public stub for platform's sysprop_library" Treehugger Robot
2019-12-19Create public stub for platform's sysprop_library Inseob Kim
Java modules using SystemAPI can now link against platform owned sysprop_library with public stub. This allows modules to use platform's public sysprops (which should be regarded as an API) without any hidden API usages, if using dynamic linking and boot class path. This doesn't affect any vendor or odm owned sysprop_library. Bug: 141246285 Bug: 145167888 Test: m Change-Id: I99824fb24a75cc8282211c2ad6c6296ae9fca393
2019-12-18Move filesystem into Config Colin Cross
The filesystem object was available through ModuleContext.Fs(), but gives too much access to the filesystem without enforicing correct dependencies. In order to support sandboxing the soong_build process move the filesystem into the Config. The next change will make it private. Bug: 146437378 Test: all Soong tests Change-Id: I5d3ae9108f120fd335b21efd612aefa078378813
2019-12-17Move imageMutator before archMutator Colin Cross
Run the imageMutator between osMutator and archMutator so that different arch variants can be set for the different partitions. Bug: 142286466 Test: m checkbuild Change-Id: I65d05714b75aa462bf9816da60fdc2deda4de593 Merged-In: I65d05714b75aa462bf9816da60fdc2deda4de593 (cherry picked from commit 9c8f687584986f6e36ebfdbda22c3cc6c21cf02d)
2019-12-13Use empty string for core image variant Colin Cross
Use the empty string for the core image variant so that modules added to imageMutator do not change their build directory. Bug: 142286466 Test: m checkbuild Change-Id: Ida4534d9a4d6176236aaa480fed359ce27acfaa1 Merged-In: Ida4534d9a4d6176236aaa480fed359ce27acfaa1 (cherry picked from commit 72d685ee7f45e5393be44ae4159edf083ac918de)
2019-12-06Move ImageMutator after archMutator Colin Cross
Move the ImageMutator to be registered just after the archMutator in preparation for moving it between osMutator and archMutator. Requries updating variants in a few tests that now run the ImageMutator. Bug: 142286466 Test: no change to build.ninja Test: all soong tests Change-Id: Ia9d2a7bc0e225bedec3c9a83ea04f471a931bf47