summaryrefslogtreecommitdiff
path: root/cc/library_test.go
diff options
context:
space:
mode:
author Alex Márquez Pérez Muñíz Díaz Púras Thaureaux <alexmarquez@google.com> 2021-09-14 21:19:31 +0000
committer Alex Márquez Pérez Muñíz Díaz Púras Thaureaux <alexmarquez@google.com> 2021-09-16 20:55:10 +0000
commit62585e84367c2528c84dcdeeb8f8494dc4d64aba (patch)
tree04e7a962175976b19a623faa1ac10475e35b6e63 /cc/library_test.go
parent4fbc62196d3ff69e483bf01e9a0fb8230d639520 (diff)
Expose TocFile via CcInfo
To reflect what's provided in SharedLibraryInfoProvider Move the logic for identifying the toc file into Starlark instead of the Soong Go code. Adapt TestGetCcInfoParseResults to expect the toc as well. Test: build/bazel/cquery/request_type_test.go:TestGetCcInfoParseResults Test: cc/library_test.go:TestCcLibrarySharedWithBazel Test: build/bazel/ci/mixed_{libc,droid}.sh Change-Id: I40ad47158cb98b14ca03c21e351988818cb01770
Diffstat (limited to 'cc/library_test.go')
-rw-r--r--cc/library_test.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/cc/library_test.go b/cc/library_test.go
index 6caee49d7..7ddfaa7fd 100644
--- a/cc/library_test.go
+++ b/cc/library_test.go
@@ -337,19 +337,29 @@ cc_library_shared {
Includes: []string{"include"},
SystemIncludes: []string{"system_include"},
RootDynamicLibraries: []string{"foo.so"},
+ TocFile: "foo.so.toc",
},
},
}
ctx := testCcWithConfig(t, config)
sharedFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
- outputFiles, err := sharedFoo.(android.OutputFileProducer).OutputFiles("")
+ producer := sharedFoo.(android.OutputFileProducer)
+ outputFiles, err := producer.OutputFiles("")
if err != nil {
t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
}
expectedOutputFiles := []string{"outputbase/execroot/__main__/foo.so"}
android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
+ tocFilePath := sharedFoo.(*Module).Toc()
+ if !tocFilePath.Valid() {
+ t.Errorf("Invalid tocFilePath: %s", tocFilePath)
+ }
+ tocFile := tocFilePath.Path()
+ expectedToc := "outputbase/execroot/__main__/foo.so.toc"
+ android.AssertStringEquals(t, "toc file", expectedToc, tocFile.String())
+
entries := android.AndroidMkEntriesForTest(t, ctx, sharedFoo)[0]
expectedFlags := []string{"-Ioutputbase/execroot/__main__/include", "-isystem outputbase/execroot/__main__/system_include"}
gotFlags := entries.EntryMap["LOCAL_EXPORT_CFLAGS"]