• Home
  • Raw
  • Download

Lines Matching refs:t

55 func testCcWithConfig(t *testing.T, config android.Config) *android.TestContext {
56 t.Helper()
61 android.FailIfErrored(t, errs)
63 android.FailIfErrored(t, errs)
68 func testCc(t *testing.T, bp string) *android.TestContext {
69 t.Helper()
74 return testCcWithConfig(t, config)
77 func testCcNoVndk(t *testing.T, bp string) *android.TestContext {
78 t.Helper()
82 return testCcWithConfig(t, config)
85 func testCcErrorWithConfig(t *testing.T, pattern string, config android.Config) {
86 t.Helper()
93 android.FailIfNoMatchingErrors(t, pattern, errs)
99 android.FailIfNoMatchingErrors(t, pattern, errs)
103 t.Fatalf("missing expected error %q (0 errors are returned)", pattern)
106 func testCcError(t *testing.T, pattern string, bp string) {
110 testCcErrorWithConfig(t, pattern, config)
114 func testCcErrorProductVndk(t *testing.T, pattern string, bp string) {
119 testCcErrorWithConfig(t, pattern, config)
130 func TestFuchsiaDeps(t *testing.T) {
131 t.Helper()
145 ctx := testCcWithConfig(t, config)
163 t.Errorf("fuchsia libs must link libcompiler_rt and libbioniccompat")
167 func TestFuchsiaTargetDecl(t *testing.T) {
168 t.Helper()
182 ctx := testCcWithConfig(t, config)
189 t.Errorf("inputs of libTest must be []string{\"foo.o\", \"bar.o\"}, but was %#v.", objs)
193 func TestVendorSrc(t *testing.T) {
194 ctx := testCc(t, `
216 t.Errorf("inputs of libTest must be []string{\"foo.o\", \"bar.o\"}, but was %#v.", objs)
220 func checkVndkModule(t *testing.T, ctx *android.TestContext, name, subDir string,
223 t.Helper()
227 t.Errorf("%q must have variant %q", name, variant)
233 t.Errorf("%q must have libraryDecorator", name)
235 t.Errorf("%q must use %q as subdir but it is using %q", name, subDir,
241 t.Fatalf("%q must have `vndkdep`", name)
244 t.Errorf("%q IsVndk() must equal to true", name)
247 t.Errorf("%q isVndkSp() must equal to %t", name, isVndkSp)
253 t.Errorf("%q isVndkExt() must equal to %t", name, isVndkExt)
257 t.Errorf("%q must extend from %q but get %q", name, extends, actualExtends)
261 func checkSnapshot(t *testing.T, ctx *android.TestContext, singleton android.TestingSingleton, modu…
264 t.Errorf("%q must have output\n", moduleName)
269 t.Errorf("%q must have single output\n", moduleName)
276t.Errorf("The input of snapshot %q must be %q, but %q", moduleName, out.Input.String(), outputFile…
280 func checkWriteFileOutput(t *testing.T, params android.TestingBuildParams, expected []string) {
281 t.Helper()
282 assertString(t, params.Rule.String(), android.WriteFile.String())
284 assertArrayString(t, actual, expected)
287 func checkVndkOutput(t *testing.T, ctx *android.TestContext, output string, expected []string) {
288 t.Helper()
290 checkWriteFileOutput(t, vndkSnapshot.Output(output), expected)
293 func checkVndkLibrariesOutput(t *testing.T, ctx *android.TestContext, module string, expected []str…
294 t.Helper()
304 checkWriteFileOutput(t, vndkLibraries.Output(output), expected)
307 func TestVndk(t *testing.T) {
374 ctx := testCcWithConfig(t, config)
376 checkVndkModule(t, ctx, "libvndk", "vndk-VER", false, "", vendorVariant)
377 checkVndkModule(t, ctx, "libvndk_private", "vndk-VER", false, "", vendorVariant)
378 checkVndkModule(t, ctx, "libvndk_sp", "vndk-sp-VER", true, "", vendorVariant)
379 checkVndkModule(t, ctx, "libvndk_sp_private", "vndk-sp-VER", true, "", vendorVariant)
401 checkSnapshot(t, ctx, snapshotSingleton, "libvndk", "libvndk.so", vndkCoreLibPath, variant)
402 checkSnapshot(t, ctx, snapshotSingleton, "libvndk", "libvndk.so", vndkCoreLib2ndPath, variant2nd)
403 checkSnapshot(t, ctx, snapshotSingleton, "libvndk_sp", "libvndk_sp-x.so", vndkSpLibPath, variant)
404 …checkSnapshot(t, ctx, snapshotSingleton, "libvndk_sp", "libvndk_sp-x.so", vndkSpLib2ndPath, varian…
407 …checkSnapshot(t, ctx, snapshotSingleton, "llndk.libraries.txt", "llndk.libraries.txt", snapshotCon…
408 …checkSnapshot(t, ctx, snapshotSingleton, "vndkcore.libraries.txt", "vndkcore.libraries.txt", snaps…
409 …checkSnapshot(t, ctx, snapshotSingleton, "vndksp.libraries.txt", "vndksp.libraries.txt", snapshotC…
410 …checkSnapshot(t, ctx, snapshotSingleton, "vndkprivate.libraries.txt", "vndkprivate.libraries.txt",…
412 checkVndkOutput(t, ctx, "vndk/vndk.libraries.txt", []string{
426 …checkVndkLibrariesOutput(t, ctx, "llndk.libraries.txt", []string{"libc.so", "libdl.so", "libft2.so…
427 …checkVndkLibrariesOutput(t, ctx, "vndkcore.libraries.txt", []string{"libvndk-private.so", "libvndk…
428 …checkVndkLibrariesOutput(t, ctx, "vndkprivate.libraries.txt", []string{"libft2.so", "libvndk-priva…
429 …checkVndkLibrariesOutput(t, ctx, "vndksp.libraries.txt", []string{"libc++.so", "libvndk_sp-x.so", …
430 checkVndkLibrariesOutput(t, ctx, "vndkcorevariant.libraries.txt", nil)
433 func TestVndkWithHostSupported(t *testing.T) {
434 ctx := testCc(t, `
464 checkVndkLibrariesOutput(t, ctx, "vndkcore.libraries.txt", []string{"libvndk_host_supported.so"})
467 func TestVndkLibrariesTxtAndroidMk(t *testing.T) {
475 ctx := testCcWithConfig(t, config)
478 entries := android.AndroidMkEntriesForTest(t, config, "", module.Module())[0]
479 assertArrayString(t, entries.EntryMap["LOCAL_MODULE_STEM"], []string{"llndk.libraries.VER.txt"})
482 func TestVndkUsingCoreVariant(t *testing.T) {
524 ctx := testCcWithConfig(t, config)
526 …checkVndkLibrariesOutput(t, ctx, "vndkcorevariant.libraries.txt", []string{"libc++.so", "libvndk2.…
529 func TestVndkWhenVndkVersionIsNotSet(t *testing.T) {
530 ctx := testCcNoVndk(t, `
541 checkVndkOutput(t, ctx, "vndk/vndk.libraries.txt", []string{
552 func TestVndkDepError(t *testing.T) {
554 testCcError(t, "dependency \".*\" of \".*\" missing variant", `
572 testCcError(t, "dependency \".*\" of \".*\" missing variant", `
591 testCcError(t, "dependency \".*\" of \".*\" missing variant", `
610 testCcError(t, "dependency \".*\" of \".*\" missing variant", `
630 testCcError(t, "module \".*\" variant \".*\": \\(.*\\) should not link to \".*\"", `
653 testCcError(t, "module \".*\" variant \".*\": \\(.*\\) should not link to \".*\"", `
672 testCcError(t, "module \".*\" variant \".*\": \\(.*\\) should not link to \".*\"", `
691 testCcError(t, "module \".*\" variant \".*\": \\(.*\\) should not link to \".*\"", `
711 testCcError(t, "module \".*\" variant \".*\": \\(.*\\) should not link to \".*\"", `
731 func TestDoubleLoadbleDep(t *testing.T) {
733 testCc(t, `
754 testCc(t, `
775 testCc(t, `
790 testCc(t, `
811 testCc(t, `
836 func TestVendorSnapshot(t *testing.T) {
891 ctx := testCcWithConfig(t, config)
912 checkSnapshot(t, ctx, snapshotSingleton, "libvendor", "libvendor.so", sharedDir, sharedVariant)
913 …checkSnapshot(t, ctx, snapshotSingleton, "libvendor_available", "libvendor_available.so", sharedDi…
921 checkSnapshot(t, ctx, snapshotSingleton, "libb", "libb.a", staticDir, staticVariant)
922 checkSnapshot(t, ctx, snapshotSingleton, "libvndk", "libvndk.a", staticDir, staticVariant)
923 checkSnapshot(t, ctx, snapshotSingleton, "libvendor", "libvendor.a", staticDir, staticVariant)
924 …checkSnapshot(t, ctx, snapshotSingleton, "libvendor_available", "libvendor_available.a", staticDir…
935 checkSnapshot(t, ctx, snapshotSingleton, "vendor_bin", "vendor_bin", binaryDir, binaryVariant)
936 …checkSnapshot(t, ctx, snapshotSingleton, "vendor_available_bin", "vendor_available_bin", binaryDir…
949 checkSnapshot(t, ctx, snapshotSingleton, "obj", "obj.o", objectDir, objectVariant)
956 t.Errorf("%q expected but not found", jsonFile)
961 func TestDoubleLoadableDepError(t *testing.T) {
963 …testCcError(t, "module \".*\" variant \".*\": link.* \".*\" which is not LL-NDK, VNDK-SP, .*double…
984 …testCcError(t, "module \".*\" variant \".*\": link.* \".*\" which is not LL-NDK, VNDK-SP, .*double…
1003 …testCcError(t, "module \".*\" variant \".*\": link.* \".*\" which is not LL-NDK, VNDK-SP, .*double…
1018 …testCcError(t, "module \".*\" variant \".*\": link.* \".*\" which is not LL-NDK, VNDK-SP, .*double…
1036 …testCcError(t, "module \".*\" variant \".*\": link.* \".*\" which is not LL-NDK, VNDK-SP, .*double…
1057 …testCcError(t, "module \".*\" variant \".*\": link.* \".*\" which is not LL-NDK, VNDK-SP, .*double…
1081 func TestVndkExt(t *testing.T) {
1151 ctx := testCcWithConfig(t, config)
1153 checkVndkModule(t, ctx, "libvndk_ext", "vndk", false, "libvndk", vendorVariant)
1154 checkVndkModule(t, ctx, "libvndk_ext_product", "vndk", false, "libvndk", productVariant)
1157 assertString(t, mod_vendor.outputFile.Path().Base(), "libvndk2-suffix.so")
1160 assertString(t, mod_product.outputFile.Path().Base(), "libvndk2-suffix.so")
1163 func TestVndkExtWithoutBoardVndkVersion(t *testing.T) {
1165 ctx := testCcNoVndk(t, `
1189 t.Errorf("\"libvndk_ext\" must extend from \"libvndk\" but get %q", extends)
1193 func TestVndkExtWithoutProductVndkVersion(t *testing.T) {
1195 ctx := testCc(t, `
1219 t.Errorf("\"libvndk_ext_product\" must extend from \"libvndk\" but get %q", extends)
1223 func TestVndkExtError(t *testing.T) {
1225 testCcError(t, "must set `vendor: true` or `product_specific: true` to set `extends: \".*\"`", `
1245 testCcError(t, "must set `extends: \"\\.\\.\\.\"` to vndk extension", `
1265 testCcErrorProductVndk(t, "must set `extends: \"\\.\\.\\.\"` to vndk extension", `
1285 testCcErrorProductVndk(t, "must not set at the same time as `vndk: {extends: \"\\.\\.\\.\"}`", `
1308 func TestVndkExtInconsistentSupportSystemProcessError(t *testing.T) {
1310 testCcError(t, "module \".*\" with mismatched support_system_process", `
1332 testCcError(t, "module \".*\" with mismatched support_system_process", `
1355 func TestVndkExtVendorAvailableFalseError(t *testing.T) {
1358 testCcError(t, "`extends` refers module \".*\" which does not have `vendor_available: true`", `
1379 …testCcErrorProductVndk(t, "`extends` refers module \".*\" which does not have `vendor_available: t…
1401 func TestVendorModuleUseVndkExt(t *testing.T) {
1403 testCc(t, `
1453 func TestVndkExtUseVendorLib(t *testing.T) {
1455 testCc(t, `
1484 testCc(t, `
1515 func TestProductVndkExtDependency(t *testing.T) {
1577 testCcWithConfig(t, config)
1580 func TestVndkSpExtUseVndkError(t *testing.T) {
1583 testCcError(t, "module \".*\" variant \".*\": \\(.*\\) should not link to \".*\"", `
1618 testCcError(t, "module \".*\" variant \".*\": \\(.*\\) should not link to \".*\"", `
1662 func TestVndkUseVndkExtError(t *testing.T) {
1665 testCcError(t, "dependency \".*\" of \".*\" missing variant", `
1696 testCcError(t, "module \".*\" variant \".*\": \\(.*\\) should not link to \".*\"", `
1731 testCcError(t, "dependency \".*\" of \".*\" missing variant", `
1765 testCcError(t, "module \".*\" variant \".*\": \\(.*\\) should not link to \".*\"", `
1801 func TestEnforceProductVndkVersion(t *testing.T) {
1869 ctx := testCcWithConfig(t, config)
1871 checkVndkModule(t, ctx, "libvndk", "vndk-VER", false, "", productVariant)
1872 checkVndkModule(t, ctx, "libvndk_sp", "vndk-sp-VER", true, "", productVariant)
1875 func TestEnforceProductVndkVersionErrors(t *testing.T) {
1876 testCcErrorProductVndk(t, "dependency \".*\" of \".*\" missing variant:\n.*image:product.VER", `
1891 testCcErrorProductVndk(t, "dependency \".*\" of \".*\" missing variant:\n.*image:product.VER", `
1905 …testCcErrorProductVndk(t, "Vendor module that is not VNDK should not link to \".*\" which is marke…
1923 testCcErrorProductVndk(t, "dependency \".*\" of \".*\" missing variant:\n.*image:product.VER", `
1938 testCcErrorProductVndk(t, "dependency \".*\" of \".*\" missing variant:\n.*image:", `
1955 func TestMakeLinkType(t *testing.T) {
2026 ctx := testCcWithConfig(t, config)
2028 assertMapKeys(t, vndkCoreLibraries(config),
2030 assertMapKeys(t, vndkSpLibraries(config),
2032 assertMapKeys(t, llndkLibraries(config),
2034 assertMapKeys(t, vndkPrivateLibraries(config),
2056 t.Run(test.name, func(t *testing.T) {
2058 assertString(t, module.makeLinkType, test.expected)
2148 func TestSplitListForSize(t *testing.T) {
2162 t.Errorf("incorrect output:")
2163 t.Errorf(" input: %#v", testCase.in)
2164 t.Errorf(" size: %d", testCase.size)
2165 t.Errorf(" expected: %#v", testCase.out)
2166 t.Errorf(" got: %#v", outStrings)
2333 func TestLinkReordering(t *testing.T) {
2380 t.Error(err)
2395 func TestStaticLibDepReordering(t *testing.T) {
2396 ctx := testCc(t, `
2424 t.Errorf("staticDeps orderings were not propagated correctly"+
2433 func TestStaticLibDepReorderingWithShared(t *testing.T) {
2434 ctx := testCc(t, `
2458 t.Errorf("staticDeps orderings did not account for shared libs"+
2467 func checkEquals(t *testing.T, message string, expected, actual interface{}) {
2469 t.Errorf(message+
2478 func TestLlndkLibrary(t *testing.T) {
2479 ctx := testCc(t, `
2497 checkEquals(t, "variants for llndk stubs", expected, actual)
2500 checkEquals(t, "use VNDK version for default stubs", "current", params.Args["apiLevel"])
2503 checkEquals(t, "override apiLevel for versioned stubs", "1", params.Args["apiLevel"])
2506 func TestLlndkHeaders(t *testing.T) {
2507 ctx := testCc(t, `
2530 t.Errorf("cflags for libvendor must contain -Imy_include, but was %#v.", cflags)
2534 func checkRuntimeLibs(t *testing.T, expected []string, module *Module) {
2537 t.Errorf("incorrect runtime_libs for shared libs"+
2599 func TestRuntimeLibs(t *testing.T) {
2600 ctx := testCc(t, runtimeLibAndroidBp)
2606 checkRuntimeLibs(t, []string{"libvendor_available1"}, module)
2609 checkRuntimeLibs(t, []string{"libvendor_available1"}, module)
2616 checkRuntimeLibs(t, []string{"libvendor_available1.vendor"}, module)
2619 checkRuntimeLibs(t, []string{"libvendor_available1.vendor", "libvendor1"}, module)
2622 func TestExcludeRuntimeLibs(t *testing.T) {
2623 ctx := testCc(t, runtimeLibAndroidBp)
2627 checkRuntimeLibs(t, []string{"libvendor_available1"}, module)
2631 checkRuntimeLibs(t, nil, module)
2634 func TestRuntimeLibsNoVndk(t *testing.T) {
2635 ctx := testCcNoVndk(t, runtimeLibAndroidBp)
2642 checkRuntimeLibs(t, []string{"libvendor_available1"}, module)
2645 checkRuntimeLibs(t, []string{"libvendor_available1", "libvendor1"}, module)
2648 func checkStaticLibs(t *testing.T, expected []string, module *Module) {
2649 t.Helper()
2652 t.Errorf("incorrect static_libs"+
2671 func TestStaticLibDepExport(t *testing.T) {
2672 ctx := testCc(t, staticLibAndroidBp)
2677 …checkStaticLibs(t, []string{"lib1", "libc++demangle", "libclang_rt.builtins-aarch64-android", "lib…
2683 …checkStaticLibs(t, []string{"lib1", "libc++_static", "libc++demangle", "libclang_rt.builtins-aarch…
2758 func TestCompilerFlags(t *testing.T) {
2763 t.Errorf("incorrect output:")
2764 t.Errorf(" input: %#v", testCase.in)
2765 t.Errorf(" expected: %#v", testCase.out)
2766 t.Errorf(" got: %#v", ctx.result)
2771 func TestVendorPublicLibraries(t *testing.T) {
2772 ctx := testCc(t, `
2816 t.Errorf("cflags for libsystem must contain -Imy_include, but was %#v.", cflags)
2824 t.Errorf("libflags for libsystem must contain %#v, but was %#v", stubPaths[0], libflags)
2832 t.Errorf("libflags for libvendor must contain %#v, but was %#v", stubPaths[0], libflags)
2837 func TestRecovery(t *testing.T) {
2838 ctx := testCc(t, `
2858 t.Errorf("variants of librecovery must be \"%s\" only, but was %#v", arm64, variants)
2863 t.Errorf("multilib was set to 32 for librecovery32, but its variants has %s.", arm64)
2868 t.Errorf("recovery variant of libHalInRecovery must not specific to device, soc, or product")
2872 func TestVersionedStubs(t *testing.T) {
2873 ctx := testCc(t, `
2911 t.Errorf("variants of libFoo expected:\n")
2913 t.Errorf("%q\n", v)
2915 t.Errorf(", but got:\n")
2917 t.Errorf("%q\n", v)
2925 t.Errorf("%q is not found in %q", libFoo1StubPath, libFlags)
2932 t.Errorf("%q is not found in %q", libFoo1VersioningMacro, cFlags)
2936 func TestVersioningMacro(t *testing.T) {
2944 checkEquals(t, tc.moduleName, tc.expected, versioningMacroName(tc.moduleName))
2948 func TestStaticExecutable(t *testing.T) {
2949 ctx := testCc(t, `
2962 t.Errorf("Static lib %q was not found in %q", lib, libFlags)
2968 t.Errorf("Shared lib %q was found in %q", lib, libFlags)
2973 func TestStaticDepsOrderWithStubs(t *testing.T) {
2974 ctx := testCc(t, `
3004 t.Errorf("staticDeps orderings were not propagated correctly"+
3013 func TestErrorsIfAModuleDependsOnDisabled(t *testing.T) {
3014 testCcError(t, `module "libA" .* depends on disabled module "libB"`, `
3033 func TestFuzzTarget(t *testing.T) {
3034 ctx := testCc(t, `
3044 func TestAidl(t *testing.T) {
3047 func assertString(t *testing.T, got, expected string) {
3048 t.Helper()
3050 t.Errorf("expected %q got %q", expected, got)
3054 func assertArrayString(t *testing.T, got, expected []string) {
3055 t.Helper()
3057 t.Errorf("expected %d (%q) got (%d) %q", len(expected), expected, len(got), got)
3062 t.Errorf("expected %d-th %q (%q) got %q (%q)",
3069 func assertMapKeys(t *testing.T, m map[string]string, expected []string) {
3070 t.Helper()
3071 assertArrayString(t, android.SortedStringKeys(m), expected)
3074 func TestDefaults(t *testing.T) {
3075 ctx := testCc(t, `
3117 t.Errorf("libshared ld rule wanted %q, got %q", w, g)
3121 t.Errorf("libboth ld rule wanted %q, got %q", w, g)
3125 t.Errorf("binary ld rule wanted %q, got %q", w, g)
3130 t.Errorf("libstatic ar rule wanted %q, got %q", w, g)
3134 t.Errorf("libboth ar rule wanted %q, got %q", w, g)
3138 func TestProductVariableDefaults(t *testing.T) {
3167 android.FailIfErrored(t, errs)
3169 android.FailIfErrored(t, errs)
3173 t.Errorf("expected -DBAR in cppflags, got %q", libfoo.flags.Local.CppFlags)