summaryrefslogtreecommitdiff
path: root/filesystem/filesystem_test.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2024-10-31 18:27:23 +0000
committer Spandan Das <spandandas@google.com> 2024-10-31 19:35:21 +0000
commit918191e35b11293605622d787603eb0a020e3187 (patch)
tree823e4139ba390f81969e9d03e0bf2749b07b4887 /filesystem/filesystem_test.go
parent3ab5fcd266917104f7425323f6b5c1b7c42cdf1a (diff)
Dedupe logic to generate linker.config.pb
Between android_filesystem and generic_system_image. `getLibsForLinkerConfig` will return a list of provideLibs and requireLibs for the fileystem. `linkerConfig.BuildLinkerConfig` will then filer out the non-stub libraries. For `android_filesystem`, requireLibs is ignored for now to match the logic in the kati built vendor.img Test: m nothing --no-skip-soong-tests Test: no diff in out/soong/.intermediates/build/make/target/product/generic/generic_system_image/android_common/gen/root-extra/system/etc/linker.config.pb paste of cmd: https://diff.googleplex.com/#key=KAqqP9bhKZMD Change-Id: I1f1d626a3a161fb2e12597909fd287533cbb8482
Diffstat (limited to 'filesystem/filesystem_test.go')
-rw-r--r--filesystem/filesystem_test.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go
index cb27f6464..8fe5daca0 100644
--- a/filesystem/filesystem_test.go
+++ b/filesystem/filesystem_test.go
@@ -670,18 +670,21 @@ func TestInstallLinkerConfigFile(t *testing.T) {
android_filesystem {
name: "myfilesystem",
deps: ["libfoo_has_no_stubs", "libfoo_has_stubs"],
- linker_config_srcs: ["linker.config.json"]
+ linker_config_srcs: ["linker.config.json"],
+ partition_type: "vendor",
}
cc_library {
name: "libfoo_has_no_stubs",
+ vendor: true,
}
cc_library {
name: "libfoo_has_stubs",
stubs: {symbol_file: "libfoo.map.txt"},
+ vendor: true,
}
`)
linkerConfigCmd := result.ModuleForTests("myfilesystem", "android_common").Rule("build_filesystem_image").RuleParams.Command
- android.AssertStringDoesContain(t, "", linkerConfigCmd, "conv_linker_config proto --force -s linker.config.json")
- android.AssertStringDoesContain(t, "", linkerConfigCmd, "--key provideLibs --value libfoo_has_stubs.so")
+ android.AssertStringDoesContain(t, "Could not find linker.config.json file in cmd", linkerConfigCmd, "conv_linker_config proto --force -s linker.config.json")
+ android.AssertStringDoesContain(t, "Could not find stub in `provideLibs`", linkerConfigCmd, "--key provideLibs --value libfoo_has_stubs.so")
}