summaryrefslogtreecommitdiff
path: root/filesystem/filesystem_test.go
diff options
context:
space:
mode:
author Kiyoung Kim <kiyoungkim@google.com> 2024-11-07 13:23:44 +0900
committer Kiyoung Kim <kiyoungkim@google.com> 2024-11-08 12:34:46 +0900
commit67118217ce5b17d5b48e3806595f3a62726a46cc (patch)
tree42d33f407aa4a8d713d23cc499e9b57f7d0560d3 /filesystem/filesystem_test.go
parent45aeb5f9c08ae74dfb070640289721bbf1e81194 (diff)
Use common interface to build linker configuration
Current filesystem logic is quite separated with systemimage, so it can end up generating linker configuration twice which can end up an error case. This change creates a common interface and let both filesystem and systemimage can implement their own function to generate linker configuration. Bug: 324995772 Test: Compared linker.config.pb of generic_system_image with this patch Change-Id: Ic515e54deeafbae74fd02bb023661606aa7e0b7c
Diffstat (limited to 'filesystem/filesystem_test.go')
-rw-r--r--filesystem/filesystem_test.go22
1 files changed, 16 insertions, 6 deletions
diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go
index 29f9373d7..205a216a0 100644
--- a/filesystem/filesystem_test.go
+++ b/filesystem/filesystem_test.go
@@ -156,11 +156,15 @@ func TestFileSystemFillsLinkerConfigWithStubLibs(t *testing.T) {
result := fixture.RunTestWithBp(t, `
android_system_image {
name: "myfilesystem",
+ base_dir: "system",
deps: [
"libfoo",
"libbar",
],
- linker_config_src: "linker.config.json",
+ linkerconfig: {
+ gen_linker_config: true,
+ linker_config_srcs: ["linker.config.json"],
+ },
}
cc_library {
@@ -176,7 +180,7 @@ func TestFileSystemFillsLinkerConfigWithStubLibs(t *testing.T) {
`)
module := result.ModuleForTests("myfilesystem", "android_common")
- output := module.Output("system/etc/linker.config.pb")
+ output := module.Output("out/soong/.intermediates/myfilesystem/android_common/root/system/etc/linker.config.pb")
android.AssertStringDoesContain(t, "linker.config.pb should have libfoo",
output.RuleParams.Command, "libfoo.so")
@@ -223,7 +227,10 @@ func TestFileSystemGathersItemsOnlyInSystemPartition(t *testing.T) {
deps: ["foo"],
},
},
- linker_config_src: "linker.config.json",
+ linkerconfig: {
+ gen_linker_config: true,
+ linker_config_srcs: ["linker.config.json"],
+ },
}
component {
name: "foo",
@@ -318,7 +325,10 @@ func TestFileSystemWithCoverageVariants(t *testing.T) {
deps: [
"libfoo",
],
- linker_config_src: "linker.config.json",
+ linkerconfig: {
+ gen_linker_config: true,
+ linker_config_srcs: ["linker.config.json"],
+ },
}
cc_library {
@@ -671,8 +681,8 @@ android_filesystem {
name: "myfilesystem",
deps: ["libfoo_has_no_stubs", "libfoo_has_stubs"],
linkerconfig: {
- gen_linker_config: true,
- linker_config_srcs: ["linker.config.json"],
+ gen_linker_config: true,
+ linker_config_srcs: ["linker.config.json"],
},
partition_type: "vendor",
}