diff options
author | 2020-10-07 20:40:38 +0000 | |
---|---|---|
committer | 2020-10-07 20:40:38 +0000 | |
commit | 45fd6ace7e6dd7c588c6cf44aa5280de7621d39b (patch) | |
tree | 857807c39d6b518409837aec3dac65d28865d1a2 /cc | |
parent | 43159bd1b7c99790d84fdedda09db3701d466f30 (diff) | |
parent | 323dc60712491c71ccdc5363c42df61f0a192487 (diff) |
Merge "Make lots of tests run in parallel"
Diffstat (limited to 'cc')
-rw-r--r-- | cc/cc_test.go | 56 | ||||
-rw-r--r-- | cc/compiler_test.go | 1 | ||||
-rw-r--r-- | cc/config/tidy_test.go | 1 | ||||
-rw-r--r-- | cc/gen_test.go | 1 | ||||
-rw-r--r-- | cc/genrule_test.go | 2 | ||||
-rw-r--r-- | cc/library_headers_test.go | 2 | ||||
-rw-r--r-- | cc/library_test.go | 4 | ||||
-rw-r--r-- | cc/object_test.go | 1 | ||||
-rw-r--r-- | cc/prebuilt_test.go | 7 | ||||
-rw-r--r-- | cc/proto_test.go | 1 | ||||
-rw-r--r-- | cc/sdk_test.go | 1 | ||||
-rw-r--r-- | cc/test_data_test.go | 1 |
12 files changed, 78 insertions, 0 deletions
diff --git a/cc/cc_test.go b/cc/cc_test.go index e0d464093..8d00239cb 100644 --- a/cc/cc_test.go +++ b/cc/cc_test.go @@ -128,6 +128,7 @@ const ( ) func TestFuchsiaDeps(t *testing.T) { + t.Parallel() t.Helper() bp := ` @@ -165,6 +166,7 @@ func TestFuchsiaDeps(t *testing.T) { } func TestFuchsiaTargetDecl(t *testing.T) { + t.Parallel() t.Helper() bp := ` @@ -191,6 +193,7 @@ func TestFuchsiaTargetDecl(t *testing.T) { } func TestVendorSrc(t *testing.T) { + t.Parallel() ctx := testCc(t, ` cc_library { name: "libTest", @@ -321,6 +324,7 @@ func checkVndkLibrariesOutput(t *testing.T, ctx *android.TestContext, module str } func TestVndk(t *testing.T) { + t.Parallel() bp := ` cc_library { name: "libvndk", @@ -447,6 +451,7 @@ func TestVndk(t *testing.T) { } func TestVndkWithHostSupported(t *testing.T) { + t.Parallel() ctx := testCc(t, ` cc_library { name: "libvndk_host_supported", @@ -481,6 +486,7 @@ func TestVndkWithHostSupported(t *testing.T) { } func TestVndkLibrariesTxtAndroidMk(t *testing.T) { + t.Parallel() bp := ` vndk_libraries_txt { name: "llndk.libraries.txt", @@ -496,6 +502,7 @@ func TestVndkLibrariesTxtAndroidMk(t *testing.T) { } func TestVndkUsingCoreVariant(t *testing.T) { + t.Parallel() bp := ` cc_library { name: "libvndk", @@ -543,6 +550,7 @@ func TestVndkUsingCoreVariant(t *testing.T) { } func TestDataLibs(t *testing.T) { + t.Parallel() bp := ` cc_test_library { name: "test_lib", @@ -593,6 +601,7 @@ func TestDataLibs(t *testing.T) { } func TestDataLibsRelativeInstallPath(t *testing.T) { + t.Parallel() bp := ` cc_test_library { name: "test_lib", @@ -640,6 +649,7 @@ func TestDataLibsRelativeInstallPath(t *testing.T) { } func TestVndkWhenVndkVersionIsNotSet(t *testing.T) { + t.Parallel() ctx := testCcNoVndk(t, ` cc_library { name: "libvndk", @@ -663,6 +673,7 @@ func TestVndkWhenVndkVersionIsNotSet(t *testing.T) { } func TestVndkDepError(t *testing.T) { + t.Parallel() // Check whether an error is emitted when a VNDK lib depends on a system lib. testCcError(t, "dependency \".*\" of \".*\" missing variant", ` cc_library { @@ -842,6 +853,7 @@ func TestVndkDepError(t *testing.T) { } func TestDoubleLoadbleDep(t *testing.T) { + t.Parallel() // okay to link : LLNDK -> double_loadable VNDK testCc(t, ` cc_library { @@ -947,6 +959,7 @@ func TestDoubleLoadbleDep(t *testing.T) { } func TestVendorSnapshotCapture(t *testing.T) { + t.Parallel() bp := ` cc_library { name: "libvndk", @@ -1080,6 +1093,7 @@ func TestVendorSnapshotCapture(t *testing.T) { } func TestVendorSnapshotUse(t *testing.T) { + t.Parallel() frameworkBp := ` cc_library { name: "libvndk", @@ -1289,6 +1303,7 @@ func TestVendorSnapshotUse(t *testing.T) { } func TestVendorSnapshotSanitizer(t *testing.T) { + t.Parallel() bp := ` vendor_snapshot_static { name: "libsnapshot", @@ -1329,6 +1344,7 @@ func assertExcludeFromVendorSnapshotIs(t *testing.T, c *Module, expected bool) { } func TestVendorSnapshotExclude(t *testing.T) { + t.Parallel() // This test verifies that the exclude_from_vendor_snapshot property // makes its way from the Android.bp source file into the module data @@ -1436,6 +1452,7 @@ func TestVendorSnapshotExclude(t *testing.T) { } func TestVendorSnapshotExcludeInVendorProprietaryPathErrors(t *testing.T) { + t.Parallel() // This test verifies that using the exclude_from_vendor_snapshot // property on a module in a vendor proprietary path generates an @@ -1476,6 +1493,7 @@ func TestVendorSnapshotExcludeInVendorProprietaryPathErrors(t *testing.T) { } func TestVendorSnapshotExcludeWithVendorAvailable(t *testing.T) { + t.Parallel() // This test verifies that using the exclude_from_vendor_snapshot // property on a module that is vendor available generates an error. A @@ -1519,6 +1537,7 @@ func TestVendorSnapshotExcludeWithVendorAvailable(t *testing.T) { } func TestDoubleLoadableDepError(t *testing.T) { + t.Parallel() // Check whether an error is emitted when a LLNDK depends on a non-double_loadable VNDK lib. testCcError(t, "module \".*\" variant \".*\": link.* \".*\" which is not LL-NDK, VNDK-SP, .*double_loadable", ` cc_library { @@ -1639,6 +1658,7 @@ func TestDoubleLoadableDepError(t *testing.T) { } func TestVndkExt(t *testing.T) { + t.Parallel() // This test checks the VNDK-Ext properties. bp := ` cc_library { @@ -1721,6 +1741,7 @@ func TestVndkExt(t *testing.T) { } func TestVndkExtWithoutBoardVndkVersion(t *testing.T) { + t.Parallel() // This test checks the VNDK-Ext properties when BOARD_VNDK_VERSION is not set. ctx := testCcNoVndk(t, ` cc_library { @@ -1751,6 +1772,7 @@ func TestVndkExtWithoutBoardVndkVersion(t *testing.T) { } func TestVndkExtWithoutProductVndkVersion(t *testing.T) { + t.Parallel() // This test checks the VNDK-Ext properties when PRODUCT_PRODUCT_VNDK_VERSION is not set. ctx := testCc(t, ` cc_library { @@ -1781,6 +1803,7 @@ func TestVndkExtWithoutProductVndkVersion(t *testing.T) { } func TestVndkExtError(t *testing.T) { + t.Parallel() // This test ensures an error is emitted in ill-formed vndk-ext definition. testCcError(t, "must set `vendor: true` or `product_specific: true` to set `extends: \".*\"`", ` cc_library { @@ -1866,6 +1889,7 @@ func TestVndkExtError(t *testing.T) { } func TestVndkExtInconsistentSupportSystemProcessError(t *testing.T) { + t.Parallel() // This test ensures an error is emitted for inconsistent support_system_process. testCcError(t, "module \".*\" with mismatched support_system_process", ` cc_library { @@ -1913,6 +1937,7 @@ func TestVndkExtInconsistentSupportSystemProcessError(t *testing.T) { } func TestVndkExtVendorAvailableFalseError(t *testing.T) { + t.Parallel() // This test ensures an error is emitted when a VNDK-Ext library extends a VNDK library // with `vendor_available: false`. testCcError(t, "`extends` refers module \".*\" which does not have `vendor_available: true`", ` @@ -1959,6 +1984,7 @@ func TestVndkExtVendorAvailableFalseError(t *testing.T) { } func TestVendorModuleUseVndkExt(t *testing.T) { + t.Parallel() // This test ensures a vendor module can depend on a VNDK-Ext library. testCc(t, ` cc_library { @@ -2011,6 +2037,7 @@ func TestVendorModuleUseVndkExt(t *testing.T) { } func TestVndkExtUseVendorLib(t *testing.T) { + t.Parallel() // This test ensures a VNDK-Ext library can depend on a vendor library. testCc(t, ` cc_library { @@ -2073,6 +2100,7 @@ func TestVndkExtUseVendorLib(t *testing.T) { } func TestProductVndkExtDependency(t *testing.T) { + t.Parallel() bp := ` cc_library { name: "libvndk", @@ -2138,6 +2166,7 @@ func TestProductVndkExtDependency(t *testing.T) { } func TestVndkSpExtUseVndkError(t *testing.T) { + t.Parallel() // This test ensures an error is emitted if a VNDK-SP-Ext library depends on a VNDK // library. testCcError(t, "module \".*\" variant \".*\": \\(.*\\) should not link to \".*\"", ` @@ -2220,6 +2249,7 @@ func TestVndkSpExtUseVndkError(t *testing.T) { } func TestVndkUseVndkExtError(t *testing.T) { + t.Parallel() // This test ensures an error is emitted if a VNDK/VNDK-SP library depends on a // VNDK-Ext/VNDK-SP-Ext library. testCcError(t, "dependency \".*\" of \".*\" missing variant", ` @@ -2359,6 +2389,7 @@ func TestVndkUseVndkExtError(t *testing.T) { } func TestEnforceProductVndkVersion(t *testing.T) { + t.Parallel() bp := ` cc_library { name: "libllndk", @@ -2433,6 +2464,7 @@ func TestEnforceProductVndkVersion(t *testing.T) { } func TestEnforceProductVndkVersionErrors(t *testing.T) { + t.Parallel() testCcErrorProductVndk(t, "dependency \".*\" of \".*\" missing variant:\n.*image:product.VER", ` cc_library { name: "libprod", @@ -2513,6 +2545,7 @@ func TestEnforceProductVndkVersionErrors(t *testing.T) { } func TestMakeLinkType(t *testing.T) { + t.Parallel() bp := ` cc_library { name: "libvndk", @@ -2706,6 +2739,7 @@ var splitListForSizeTestCases = []struct { } func TestSplitListForSize(t *testing.T) { + t.Parallel() for _, testCase := range splitListForSizeTestCases { out, _ := splitListForSize(android.PathsForTesting(testCase.in...), testCase.size) @@ -2891,6 +2925,7 @@ func parseModuleDeps(text string) (modulesInOrder []android.Path, allDeps map[an } func TestLinkReordering(t *testing.T) { + t.Parallel() for _, testCase := range staticLinkDepOrderTestCases { errs := []string{} @@ -2953,6 +2988,7 @@ func getOutputPaths(ctx *android.TestContext, variant string, moduleNames []stri } func TestStaticLibDepReordering(t *testing.T) { + t.Parallel() ctx := testCc(t, ` cc_library { name: "a", @@ -2991,6 +3027,7 @@ func TestStaticLibDepReordering(t *testing.T) { } func TestStaticLibDepReorderingWithShared(t *testing.T) { + t.Parallel() ctx := testCc(t, ` cc_library { name: "a", @@ -3037,6 +3074,7 @@ func checkEquals(t *testing.T, message string, expected, actual interface{}) { } func TestLlndkLibrary(t *testing.T) { + t.Parallel() ctx := testCc(t, ` cc_library { name: "libllndk", @@ -3065,6 +3103,7 @@ func TestLlndkLibrary(t *testing.T) { } func TestLlndkHeaders(t *testing.T) { + t.Parallel() ctx := testCc(t, ` llndk_headers { name: "libllndk_headers", @@ -3158,6 +3197,7 @@ const runtimeLibAndroidBp = ` ` func TestRuntimeLibs(t *testing.T) { + t.Parallel() ctx := testCc(t, runtimeLibAndroidBp) // runtime_libs for core variants use the module names without suffixes. @@ -3181,6 +3221,7 @@ func TestRuntimeLibs(t *testing.T) { } func TestExcludeRuntimeLibs(t *testing.T) { + t.Parallel() ctx := testCc(t, runtimeLibAndroidBp) variant := "android_arm64_armv8-a_shared" @@ -3193,6 +3234,7 @@ func TestExcludeRuntimeLibs(t *testing.T) { } func TestRuntimeLibsNoVndk(t *testing.T) { + t.Parallel() ctx := testCcNoVndk(t, runtimeLibAndroidBp) // If DeviceVndkVersion is not defined, then runtime_libs are copied as-is. @@ -3230,6 +3272,7 @@ const staticLibAndroidBp = ` ` func TestStaticLibDepExport(t *testing.T) { + t.Parallel() ctx := testCc(t, staticLibAndroidBp) // Check the shared version of lib2. @@ -3317,6 +3360,7 @@ func (ctx *mockContext) PropertyErrorf(property, format string, args ...interfac } func TestCompilerFlags(t *testing.T) { + t.Parallel() for _, testCase := range compilerFlagsTestCases { ctx := &mockContext{result: true} CheckBadCompilerFlags(ctx, "", []string{testCase.in}) @@ -3330,6 +3374,7 @@ func TestCompilerFlags(t *testing.T) { } func TestVendorPublicLibraries(t *testing.T) { + t.Parallel() ctx := testCc(t, ` cc_library_headers { name: "libvendorpublic_headers", @@ -3396,6 +3441,7 @@ func TestVendorPublicLibraries(t *testing.T) { } func TestRecovery(t *testing.T) { + t.Parallel() ctx := testCc(t, ` cc_library_shared { name: "librecovery", @@ -3431,6 +3477,7 @@ func TestRecovery(t *testing.T) { } func TestDataLibsPrebuiltSharedTestLibrary(t *testing.T) { + t.Parallel() bp := ` cc_prebuilt_test_library_shared { name: "test_lib", @@ -3477,6 +3524,7 @@ func TestDataLibsPrebuiltSharedTestLibrary(t *testing.T) { } func TestVersionedStubs(t *testing.T) { + t.Parallel() ctx := testCc(t, ` cc_library_shared { name: "libFoo", @@ -3541,6 +3589,7 @@ func TestVersionedStubs(t *testing.T) { } func TestVersioningMacro(t *testing.T) { + t.Parallel() for _, tc := range []struct{ moduleName, expected string }{ {"libc", "__LIBC_API__"}, {"libfoo", "__LIBFOO_API__"}, @@ -3553,6 +3602,7 @@ func TestVersioningMacro(t *testing.T) { } func TestStaticExecutable(t *testing.T) { + t.Parallel() ctx := testCc(t, ` cc_binary { name: "static_test", @@ -3578,6 +3628,7 @@ func TestStaticExecutable(t *testing.T) { } func TestStaticDepsOrderWithStubs(t *testing.T) { + t.Parallel() ctx := testCc(t, ` cc_binary { name: "mybin", @@ -3618,6 +3669,7 @@ func TestStaticDepsOrderWithStubs(t *testing.T) { } func TestErrorsIfAModuleDependsOnDisabled(t *testing.T) { + t.Parallel() testCcError(t, `module "libA" .* depends on disabled module "libB"`, ` cc_library { name: "libA", @@ -3638,6 +3690,7 @@ func TestErrorsIfAModuleDependsOnDisabled(t *testing.T) { // Simple smoke test for the cc_fuzz target that ensures the rule compiles // correctly. func TestFuzzTarget(t *testing.T) { + t.Parallel() ctx := testCc(t, ` cc_fuzz { name: "fuzz_smoke_test", @@ -3649,6 +3702,7 @@ func TestFuzzTarget(t *testing.T) { } func TestAidl(t *testing.T) { + t.Parallel() } func assertString(t *testing.T, got, expected string) { @@ -3679,6 +3733,7 @@ func assertMapKeys(t *testing.T, m map[string]string, expected []string) { } func TestDefaults(t *testing.T) { + t.Parallel() ctx := testCc(t, ` cc_defaults { name: "defaults", @@ -3743,6 +3798,7 @@ func TestDefaults(t *testing.T) { } func TestProductVariableDefaults(t *testing.T) { + t.Parallel() bp := ` cc_defaults { name: "libfoo_defaults", diff --git a/cc/compiler_test.go b/cc/compiler_test.go index c301388ae..cf553bdc6 100644 --- a/cc/compiler_test.go +++ b/cc/compiler_test.go @@ -19,6 +19,7 @@ import ( ) func TestIsThirdParty(t *testing.T) { + t.Parallel() shouldFail := []string{ "external/foo/", "vendor/bar/", diff --git a/cc/config/tidy_test.go b/cc/config/tidy_test.go index 4ed8b231d..3ea2f6b7d 100644 --- a/cc/config/tidy_test.go +++ b/cc/config/tidy_test.go @@ -19,6 +19,7 @@ import ( ) func TestTidyChecksForDir(t *testing.T) { + t.Parallel() testCases := []struct { input string expected string diff --git a/cc/gen_test.go b/cc/gen_test.go index 4b9a36e6b..ee89873a0 100644 --- a/cc/gen_test.go +++ b/cc/gen_test.go @@ -21,6 +21,7 @@ import ( ) func TestGen(t *testing.T) { + t.Parallel() t.Run("simple", func(t *testing.T) { ctx := testCc(t, ` cc_library_shared { diff --git a/cc/genrule_test.go b/cc/genrule_test.go index a366f765c..6623d20fb 100644 --- a/cc/genrule_test.go +++ b/cc/genrule_test.go @@ -30,6 +30,7 @@ func testGenruleContext(config android.Config) *android.TestContext { } func TestArchGenruleCmd(t *testing.T) { + t.Parallel() fs := map[string][]byte{ "tool": nil, "foo": nil, @@ -78,6 +79,7 @@ func TestArchGenruleCmd(t *testing.T) { } func TestLibraryGenruleCmd(t *testing.T) { + t.Parallel() bp := ` cc_library { name: "libboth", diff --git a/cc/library_headers_test.go b/cc/library_headers_test.go index 564ef61fb..db42d25c9 100644 --- a/cc/library_headers_test.go +++ b/cc/library_headers_test.go @@ -20,6 +20,7 @@ import ( ) func TestLibraryHeaders(t *testing.T) { + t.Parallel() ctx := testCc(t, ` cc_library_headers { name: "headers", @@ -41,6 +42,7 @@ func TestLibraryHeaders(t *testing.T) { } func TestPrebuiltLibraryHeaders(t *testing.T) { + t.Parallel() ctx := testCc(t, ` cc_prebuilt_library_headers { name: "headers", diff --git a/cc/library_test.go b/cc/library_test.go index 49838b48e..d42f07332 100644 --- a/cc/library_test.go +++ b/cc/library_test.go @@ -22,6 +22,7 @@ import ( ) func TestLibraryReuse(t *testing.T) { + t.Parallel() t.Run("simple", func(t *testing.T) { ctx := testCc(t, ` cc_library { @@ -190,6 +191,7 @@ func TestLibraryReuse(t *testing.T) { } func TestStubsVersions(t *testing.T) { + t.Parallel() bp := ` cc_library { name: "libfoo", @@ -213,6 +215,7 @@ func TestStubsVersions(t *testing.T) { } func TestStubsVersions_NotSorted(t *testing.T) { + t.Parallel() bp := ` cc_library { name: "libfoo", @@ -228,6 +231,7 @@ func TestStubsVersions_NotSorted(t *testing.T) { } func TestStubsVersions_ParseError(t *testing.T) { + t.Parallel() bp := ` cc_library { name: "libfoo", diff --git a/cc/object_test.go b/cc/object_test.go index 6ff8a00c3..a00604463 100644 --- a/cc/object_test.go +++ b/cc/object_test.go @@ -19,6 +19,7 @@ import ( ) func TestLinkerScript(t *testing.T) { + t.Parallel() t.Run("script", func(t *testing.T) { testCc(t, ` cc_object { diff --git a/cc/prebuilt_test.go b/cc/prebuilt_test.go index 52416ac3b..afae261dc 100644 --- a/cc/prebuilt_test.go +++ b/cc/prebuilt_test.go @@ -43,6 +43,7 @@ func testPrebuilt(t *testing.T, bp string, fs map[string][]byte) *android.TestCo } func TestPrebuilt(t *testing.T) { + t.Parallel() bp := ` cc_library { name: "liba", @@ -172,6 +173,7 @@ func TestPrebuilt(t *testing.T) { } func TestPrebuiltLibraryShared(t *testing.T) { + t.Parallel() ctx := testPrebuilt(t, ` cc_prebuilt_library_shared { name: "libtest", @@ -189,6 +191,7 @@ func TestPrebuiltLibraryShared(t *testing.T) { } func TestPrebuiltLibraryStatic(t *testing.T) { + t.Parallel() ctx := testPrebuilt(t, ` cc_prebuilt_library_static { name: "libtest", @@ -203,6 +206,7 @@ func TestPrebuiltLibraryStatic(t *testing.T) { } func TestPrebuiltLibrary(t *testing.T) { + t.Parallel() ctx := testPrebuilt(t, ` cc_prebuilt_library { name: "libtest", @@ -229,6 +233,7 @@ func TestPrebuiltLibrary(t *testing.T) { } func TestPrebuiltLibraryStem(t *testing.T) { + t.Parallel() ctx := testPrebuilt(t, ` cc_prebuilt_library { name: "libfoo", @@ -256,6 +261,7 @@ func TestPrebuiltLibraryStem(t *testing.T) { } func TestPrebuiltLibrarySharedStem(t *testing.T) { + t.Parallel() ctx := testPrebuilt(t, ` cc_prebuilt_library_shared { name: "libfoo", @@ -274,6 +280,7 @@ func TestPrebuiltLibrarySharedStem(t *testing.T) { } func TestPrebuiltSymlinkedHostBinary(t *testing.T) { + t.Parallel() if android.BuildOs != android.Linux { t.Skipf("Skipping host prebuilt testing that is only supported on %s not %s", android.Linux, android.BuildOs) } diff --git a/cc/proto_test.go b/cc/proto_test.go index f8bbd2643..2d059ebd1 100644 --- a/cc/proto_test.go +++ b/cc/proto_test.go @@ -22,6 +22,7 @@ import ( ) func TestProto(t *testing.T) { + t.Parallel() t.Run("simple", func(t *testing.T) { ctx := testCc(t, ` cc_library_shared { diff --git a/cc/sdk_test.go b/cc/sdk_test.go index 5a3c181dc..7b9867c1b 100644 --- a/cc/sdk_test.go +++ b/cc/sdk_test.go @@ -21,6 +21,7 @@ import ( ) func TestSdkMutator(t *testing.T) { + t.Parallel() bp := ` cc_library { name: "libsdk", diff --git a/cc/test_data_test.go b/cc/test_data_test.go index ae59e2f0f..7908aa089 100644 --- a/cc/test_data_test.go +++ b/cc/test_data_test.go @@ -109,6 +109,7 @@ var testDataTests = []struct { } func TestDataTests(t *testing.T) { + t.Parallel() buildDir, err := ioutil.TempDir("", "soong_test_test") if err != nil { t.Fatal(err) |