diff options
author | 2024-02-14 10:25:55 +0000 | |
---|---|---|
committer | 2024-02-14 10:25:55 +0000 | |
commit | ac0c87311d6671cf442120ff56e24c40418de441 (patch) | |
tree | bfed83606ef7c583a59e35a59928b9386f8be354 /sysprop/sysprop_test.go | |
parent | be3ea4f149c8688a8b76c4587a4c5f6813d567c1 (diff) |
Revert^2 "Integrate Rust-specific System Properties into rules generation."
This reverts commit be3ea4f149c8688a8b76c4587a4c5f6813d567c1.
Reason for revert: Reland
Change-Id: Ic003c52a1477da9a6a70b82e4d4ae4a55edc584f
Diffstat (limited to 'sysprop/sysprop_test.go')
-rw-r--r-- | sysprop/sysprop_test.go | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/sysprop/sysprop_test.go b/sysprop/sysprop_test.go index 80b86e059..e6464a7bd 100644 --- a/sysprop/sysprop_test.go +++ b/sysprop/sysprop_test.go @@ -22,6 +22,7 @@ import ( "android/soong/android" "android/soong/cc" "android/soong/java" + "android/soong/rust" "github.com/google/blueprint/proptools" ) @@ -45,18 +46,6 @@ func test(t *testing.T, bp string) *android.TestResult { recovery_available: true, } - cc_library { - name: "liblog", - no_libcrt: true, - nocrt: true, - system_shared_libs: [], - recovery_available: true, - host_supported: true, - llndk: { - symbol_file: "liblog.map.txt", - } - } - java_library { name: "sysprop-library-stub-platform", sdk_version: "core_current", @@ -73,6 +62,15 @@ func test(t *testing.T, bp string) *android.TestResult { product_specific: true, sdk_version: "core_current", } + + rust_library { + name: "librustutils", + crate_name: "rustutils", + srcs: ["librustutils/lib.rs"], + product_available: true, + vendor_available: true, + min_sdk_version: "29", + } ` mockFS := android.MockFS{ @@ -114,11 +112,14 @@ func test(t *testing.T, bp string) *android.TestResult { "android/sysprop/PlatformProperties.sysprop": nil, "com/android/VendorProperties.sysprop": nil, "com/android2/OdmProperties.sysprop": nil, + + "librustutils/lib.rs": nil, } result := android.GroupFixturePreparers( cc.PrepareForTestWithCcDefaultModules, java.PrepareForTestWithJavaDefaultModules, + rust.PrepareForTestWithRustDefaultModules, PrepareForTestWithSyspropBuildComponents, android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { variables.DeviceSystemSdkVersions = []string{"28"} @@ -342,6 +343,10 @@ func TestApexAvailabilityIsForwarded(t *testing.T) { javaModule := result.ModuleForTests("sysprop-platform", "android_common").Module().(*java.Library) propFromJava := javaModule.ApexProperties.Apex_available android.AssertDeepEquals(t, "apex_available forwarding to java module", expected, propFromJava) + + rustModule := result.ModuleForTests("libsysprop_platform_rust", "android_arm64_armv8-a_rlib_rlib-std").Module().(*rust.Module) + propFromRust := rustModule.ApexProperties.Apex_available + android.AssertDeepEquals(t, "apex_available forwarding to rust module", expected, propFromRust) } func TestMinSdkVersionIsForwarded(t *testing.T) { @@ -357,6 +362,9 @@ func TestMinSdkVersionIsForwarded(t *testing.T) { java: { min_sdk_version: "30", }, + rust: { + min_sdk_version: "29", + } } `) @@ -367,4 +375,8 @@ func TestMinSdkVersionIsForwarded(t *testing.T) { javaModule := result.ModuleForTests("sysprop-platform", "android_common").Module().(*java.Library) propFromJava := javaModule.MinSdkVersionString() android.AssertStringEquals(t, "min_sdk_version forwarding to java module", "30", propFromJava) + + rustModule := result.ModuleForTests("libsysprop_platform_rust", "android_arm64_armv8-a_rlib_rlib-std").Module().(*rust.Module) + propFromRust := proptools.String(rustModule.Properties.Min_sdk_version) + android.AssertStringEquals(t, "min_sdk_version forwarding to rust module", "29", propFromRust) } |