diff options
Diffstat (limited to 'cc/cc_test.go')
-rw-r--r-- | cc/cc_test.go | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/cc/cc_test.go b/cc/cc_test.go index d4955c615..3d75bf5a6 100644 --- a/cc/cc_test.go +++ b/cc/cc_test.go @@ -958,6 +958,7 @@ func TestLlndkLibrary(t *testing.T) { cc_library_headers { name: "libexternal_llndk_headers", export_include_dirs: ["include_llndk"], + export_system_include_dirs: ["include_system_llndk"], llndk: { symbol_file: "libllndk.map.txt", }, @@ -973,6 +974,17 @@ func TestLlndkLibrary(t *testing.T) { }, export_include_dirs: ["include"], } + + cc_library { + name: "libllndk_with_system_headers", + llndk: { + symbol_file: "libllndk.map.txt", + export_llndk_headers: ["libexternal_llndk_headers"], + export_headers_as_system: true, + }, + export_include_dirs: ["include"], + export_system_include_dirs: ["include_system"], + } `) actual := result.ModuleVariantsForTests("libllndk") for i := 0; i < len(actual); i++ { @@ -990,20 +1002,26 @@ func TestLlndkLibrary(t *testing.T) { params := result.ModuleForTests("libllndk", "android_vendor_arm_armv7-a-neon_shared").Description("generate stub") android.AssertSame(t, "use Vendor API level for default stubs", "202404", params.Args["apiLevel"]) - checkExportedIncludeDirs := func(module, variant string, expectedDirs ...string) { + checkExportedIncludeDirs := func(module, variant string, expectedSystemDirs []string, expectedDirs ...string) { t.Helper() m := result.ModuleForTests(module, variant).Module() f, _ := android.SingletonModuleProvider(result, m, FlagExporterInfoProvider) android.AssertPathsRelativeToTopEquals(t, "exported include dirs for "+module+"["+variant+"]", expectedDirs, f.IncludeDirs) + android.AssertPathsRelativeToTopEquals(t, "exported include dirs for "+module+"["+variant+"]", + expectedSystemDirs, f.SystemIncludeDirs) } - checkExportedIncludeDirs("libllndk", coreVariant, "include") - checkExportedIncludeDirs("libllndk", vendorVariant, "include") - checkExportedIncludeDirs("libllndk_with_external_headers", coreVariant, "include") - checkExportedIncludeDirs("libllndk_with_external_headers", vendorVariant, "include_llndk") - checkExportedIncludeDirs("libllndk_with_override_headers", coreVariant, "include") - checkExportedIncludeDirs("libllndk_with_override_headers", vendorVariant, "include_llndk") + checkExportedIncludeDirs("libllndk", coreVariant, nil, "include") + checkExportedIncludeDirs("libllndk", vendorVariant, nil, "include") + checkExportedIncludeDirs("libllndk_with_external_headers", coreVariant, nil, "include") + checkExportedIncludeDirs("libllndk_with_external_headers", vendorVariant, + []string{"include_system_llndk"}, "include_llndk") + checkExportedIncludeDirs("libllndk_with_override_headers", coreVariant, nil, "include") + checkExportedIncludeDirs("libllndk_with_override_headers", vendorVariant, nil, "include_llndk") + checkExportedIncludeDirs("libllndk_with_system_headers", coreVariant, []string{"include_system"}, "include") + checkExportedIncludeDirs("libllndk_with_system_headers", vendorVariant, + []string{"include_system", "include", "include_system_llndk"}, "include_llndk") checkAbiLinkerIncludeDirs := func(module string) { t.Helper() @@ -1016,12 +1034,14 @@ func TestLlndkLibrary(t *testing.T) { } vendorModule := result.ModuleForTests(module, vendorVariant).Module() vendorInfo, _ := android.SingletonModuleProvider(result, vendorModule, FlagExporterInfoProvider) + vendorDirs := android.Concat(vendorInfo.IncludeDirs, vendorInfo.SystemIncludeDirs) android.AssertStringEquals(t, module+" has different exported include dirs for vendor variant and ABI check", - android.JoinPathsWithPrefix(vendorInfo.IncludeDirs, "-I"), abiCheckFlags) + android.JoinPathsWithPrefix(vendorDirs, "-I"), abiCheckFlags) } checkAbiLinkerIncludeDirs("libllndk") checkAbiLinkerIncludeDirs("libllndk_with_override_headers") checkAbiLinkerIncludeDirs("libllndk_with_external_headers") + checkAbiLinkerIncludeDirs("libllndk_with_system_headers") } func TestLlndkHeaders(t *testing.T) { |