Loading cc/cc_test.go +17 −39 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package cc import ( "fmt" "io/ioutil" "os" "path/filepath" "reflect" Loading @@ -27,33 +26,12 @@ import ( "android/soong/android" ) var buildDir string func setUp() { var err error buildDir, err = ioutil.TempDir("", "soong_cc_test") if err != nil { panic(err) } } func tearDown() { os.RemoveAll(buildDir) } func TestMain(m *testing.M) { run := func() int { setUp() defer tearDown() return m.Run() } os.Exit(run()) os.Exit(m.Run()) } var ccFixtureFactory = android.NewFixtureFactory( &buildDir, nil, prepareForCcTest, ) Loading Loading @@ -101,7 +79,7 @@ func testCc(t *testing.T, bp string) *android.TestContext { // deprecated func testCcNoVndk(t *testing.T, bp string) *android.TestContext { t.Helper() config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.Platform_vndk_version = StringPtr("VER") return testCcWithConfig(t, config) Loading @@ -114,7 +92,7 @@ func testCcNoVndk(t *testing.T, bp string) *android.TestContext { // deprecated func testCcNoProductVndk(t *testing.T, bp string) *android.TestContext { t.Helper() config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") Loading @@ -141,7 +119,7 @@ func testCcErrorWithConfig(t *testing.T, pattern string, config android.Config) // deprecated func testCcError(t *testing.T, pattern string, bp string) { t.Helper() config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") testCcErrorWithConfig(t, pattern, config) Loading @@ -155,7 +133,7 @@ func testCcError(t *testing.T, pattern string, bp string) { // deprecated func testCcErrorProductVndk(t *testing.T, pattern string, bp string) { t.Helper() config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.ProductVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") Loading Loading @@ -474,7 +452,7 @@ func TestVndk(t *testing.T) { } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.ProductVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") Loading @@ -495,7 +473,7 @@ func TestVndk(t *testing.T) { // Check VNDK snapshot output. snapshotDir := "vndk-snapshot" snapshotVariantPath := filepath.Join(buildDir, snapshotDir, "arm64") snapshotVariantPath := filepath.Join("out/soong", snapshotDir, "arm64") vndkLibPath := filepath.Join(snapshotVariantPath, fmt.Sprintf("arch-%s-%s", "arm64", "armv8-a")) Loading Loading @@ -596,7 +574,7 @@ func TestVndkLibrariesTxtAndroidMk(t *testing.T) { name: "llndk.libraries.txt", insert_vndk_version: true, }` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") ctx := testCcWithConfig(t, config) Loading Loading @@ -646,7 +624,7 @@ func TestVndkUsingCoreVariant(t *testing.T) { } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") config.TestProductVariables.VndkUseCoreVariant = BoolPtr(true) Loading @@ -673,7 +651,7 @@ func TestDataLibs(t *testing.T) { } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") config.TestProductVariables.VndkUseCoreVariant = BoolPtr(true) Loading Loading @@ -724,7 +702,7 @@ func TestDataLibsRelativeInstallPath(t *testing.T) { } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") config.TestProductVariables.VndkUseCoreVariant = BoolPtr(true) Loading Loading @@ -1349,7 +1327,7 @@ func TestVndkExt(t *testing.T) { nocrt: true, } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.ProductVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") Loading Loading @@ -1794,7 +1772,7 @@ func TestProductVndkExtDependency(t *testing.T) { nocrt: true, } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.ProductVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") Loading Loading @@ -2349,7 +2327,7 @@ func TestMakeLinkType(t *testing.T) { } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") // native:vndk Loading Loading @@ -3141,7 +3119,7 @@ func TestDataLibsPrebuiltSharedTestLibrary(t *testing.T) { } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") config.TestProductVariables.VndkUseCoreVariant = BoolPtr(true) Loading Loading @@ -3536,7 +3514,7 @@ func TestInstallSharedLibs(t *testing.T) { } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) ctx := testCcWithConfig(t, config) hostBin := ctx.ModuleForTests("bin", config.BuildOSTarget.String()).Description("install") Loading cc/genrule_test.go +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ func TestArchGenruleCmd(t *testing.T) { }, } ` config := android.TestArchConfig(buildDir, nil, bp, fs) config := android.TestArchConfig(t.TempDir(), nil, bp, fs) ctx := testGenruleContext(config) Loading cc/library_test.go +2 −2 Original line number Diff line number Diff line Loading @@ -199,7 +199,7 @@ func TestStubsVersions(t *testing.T) { }, } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.Platform_version_active_codenames = []string{"R"} ctx := testCcWithConfig(t, config) Loading @@ -222,7 +222,7 @@ func TestStubsVersions_NotSorted(t *testing.T) { }, } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.Platform_version_active_codenames = []string{"R"} testCcErrorWithConfig(t, `"libfoo" .*: versions: not sorted`, config) } Loading cc/vendor_snapshot_test.go +15 −15 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ func TestVendorSnapshotCapture(t *testing.T) { symbol_file: "", } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") ctx := testCcWithConfig(t, config) Loading @@ -94,7 +94,7 @@ func TestVendorSnapshotCapture(t *testing.T) { // Check Vendor snapshot output. snapshotDir := "vendor-snapshot" snapshotVariantPath := filepath.Join(buildDir, snapshotDir, "arm64") snapshotVariantPath := filepath.Join("out/soong", snapshotDir, "arm64") snapshotSingleton := ctx.SingletonForTests("vendor-snapshot") var jsonFiles []string Loading Loading @@ -212,7 +212,7 @@ func TestVendorSnapshotDirected(t *testing.T) { nocrt: true, } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") config.TestProductVariables.DirectedVendorSnapshot = true Loading @@ -224,7 +224,7 @@ func TestVendorSnapshotDirected(t *testing.T) { // Check Vendor snapshot output. snapshotDir := "vendor-snapshot" snapshotVariantPath := filepath.Join(buildDir, snapshotDir, "arm64") snapshotVariantPath := filepath.Join("out/soong", snapshotDir, "arm64") snapshotSingleton := ctx.SingletonForTests("vendor-snapshot") var includeJsonFiles []string Loading Loading @@ -516,7 +516,7 @@ func TestVendorSnapshotUse(t *testing.T) { "vndk/libvndk.so": nil, } config := TestConfig(buildDir, android.Android, nil, "", mockFS) config := TestConfig(t.TempDir(), android.Android, nil, "", mockFS) config.TestProductVariables.DeviceVndkVersion = StringPtr("BOARD") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") ctx := CreateTestContext(config) Loading Loading @@ -628,7 +628,7 @@ func TestVendorSnapshotSanitizer(t *testing.T) { }, } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("BOARD") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") ctx := testCcWithConfig(t, config) Loading Loading @@ -707,7 +707,7 @@ func TestVendorSnapshotExclude(t *testing.T) { "device/vendor.cpp": nil, } config := TestConfig(buildDir, android.Android, nil, "", mockFS) config := TestConfig(t.TempDir(), android.Android, nil, "", mockFS) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") ctx := CreateTestContext(config) Loading @@ -730,7 +730,7 @@ func TestVendorSnapshotExclude(t *testing.T) { // Verify the content of the vendor snapshot. snapshotDir := "vendor-snapshot" snapshotVariantPath := filepath.Join(buildDir, snapshotDir, "arm64") snapshotVariantPath := filepath.Join("out/soong", snapshotDir, "arm64") snapshotSingleton := ctx.SingletonForTests("vendor-snapshot") var includeJsonFiles []string Loading Loading @@ -799,7 +799,7 @@ func TestVendorSnapshotExcludeInVendorProprietaryPathErrors(t *testing.T) { "device/vendor.cpp": nil, } config := TestConfig(buildDir, android.Android, nil, "", mockFS) config := TestConfig(t.TempDir(), android.Android, nil, "", mockFS) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") ctx := CreateTestContext(config) Loading Loading @@ -873,7 +873,7 @@ func TestRecoverySnapshotCapture(t *testing.T) { recovery_available: true, } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.RecoverySnapshotVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") ctx := testCcWithConfig(t, config) Loading @@ -881,7 +881,7 @@ func TestRecoverySnapshotCapture(t *testing.T) { // Check Recovery snapshot output. snapshotDir := "recovery-snapshot" snapshotVariantPath := filepath.Join(buildDir, snapshotDir, "arm64") snapshotVariantPath := filepath.Join("out/soong", snapshotDir, "arm64") snapshotSingleton := ctx.SingletonForTests("recovery-snapshot") var jsonFiles []string Loading Loading @@ -991,7 +991,7 @@ func TestRecoverySnapshotExclude(t *testing.T) { "device/recovery.cpp": nil, } config := TestConfig(buildDir, android.Android, nil, "", mockFS) config := TestConfig(t.TempDir(), android.Android, nil, "", mockFS) config.TestProductVariables.RecoverySnapshotVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") ctx := CreateTestContext(config) Loading @@ -1014,7 +1014,7 @@ func TestRecoverySnapshotExclude(t *testing.T) { // Verify the content of the recovery snapshot. snapshotDir := "recovery-snapshot" snapshotVariantPath := filepath.Join(buildDir, snapshotDir, "arm64") snapshotVariantPath := filepath.Join("out/soong", snapshotDir, "arm64") snapshotSingleton := ctx.SingletonForTests("recovery-snapshot") var includeJsonFiles []string Loading Loading @@ -1091,7 +1091,7 @@ func TestRecoverySnapshotDirected(t *testing.T) { nocrt: true, } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.RecoverySnapshotVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") Loading @@ -1104,7 +1104,7 @@ func TestRecoverySnapshotDirected(t *testing.T) { // Check recovery snapshot output. snapshotDir := "recovery-snapshot" snapshotVariantPath := filepath.Join(buildDir, snapshotDir, "arm64") snapshotVariantPath := filepath.Join("out/soong", snapshotDir, "arm64") snapshotSingleton := ctx.SingletonForTests("recovery-snapshot") var includeJsonFiles []string Loading Loading
cc/cc_test.go +17 −39 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package cc import ( "fmt" "io/ioutil" "os" "path/filepath" "reflect" Loading @@ -27,33 +26,12 @@ import ( "android/soong/android" ) var buildDir string func setUp() { var err error buildDir, err = ioutil.TempDir("", "soong_cc_test") if err != nil { panic(err) } } func tearDown() { os.RemoveAll(buildDir) } func TestMain(m *testing.M) { run := func() int { setUp() defer tearDown() return m.Run() } os.Exit(run()) os.Exit(m.Run()) } var ccFixtureFactory = android.NewFixtureFactory( &buildDir, nil, prepareForCcTest, ) Loading Loading @@ -101,7 +79,7 @@ func testCc(t *testing.T, bp string) *android.TestContext { // deprecated func testCcNoVndk(t *testing.T, bp string) *android.TestContext { t.Helper() config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.Platform_vndk_version = StringPtr("VER") return testCcWithConfig(t, config) Loading @@ -114,7 +92,7 @@ func testCcNoVndk(t *testing.T, bp string) *android.TestContext { // deprecated func testCcNoProductVndk(t *testing.T, bp string) *android.TestContext { t.Helper() config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") Loading @@ -141,7 +119,7 @@ func testCcErrorWithConfig(t *testing.T, pattern string, config android.Config) // deprecated func testCcError(t *testing.T, pattern string, bp string) { t.Helper() config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") testCcErrorWithConfig(t, pattern, config) Loading @@ -155,7 +133,7 @@ func testCcError(t *testing.T, pattern string, bp string) { // deprecated func testCcErrorProductVndk(t *testing.T, pattern string, bp string) { t.Helper() config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.ProductVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") Loading Loading @@ -474,7 +452,7 @@ func TestVndk(t *testing.T) { } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.ProductVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") Loading @@ -495,7 +473,7 @@ func TestVndk(t *testing.T) { // Check VNDK snapshot output. snapshotDir := "vndk-snapshot" snapshotVariantPath := filepath.Join(buildDir, snapshotDir, "arm64") snapshotVariantPath := filepath.Join("out/soong", snapshotDir, "arm64") vndkLibPath := filepath.Join(snapshotVariantPath, fmt.Sprintf("arch-%s-%s", "arm64", "armv8-a")) Loading Loading @@ -596,7 +574,7 @@ func TestVndkLibrariesTxtAndroidMk(t *testing.T) { name: "llndk.libraries.txt", insert_vndk_version: true, }` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") ctx := testCcWithConfig(t, config) Loading Loading @@ -646,7 +624,7 @@ func TestVndkUsingCoreVariant(t *testing.T) { } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") config.TestProductVariables.VndkUseCoreVariant = BoolPtr(true) Loading @@ -673,7 +651,7 @@ func TestDataLibs(t *testing.T) { } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") config.TestProductVariables.VndkUseCoreVariant = BoolPtr(true) Loading Loading @@ -724,7 +702,7 @@ func TestDataLibsRelativeInstallPath(t *testing.T) { } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") config.TestProductVariables.VndkUseCoreVariant = BoolPtr(true) Loading Loading @@ -1349,7 +1327,7 @@ func TestVndkExt(t *testing.T) { nocrt: true, } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.ProductVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") Loading Loading @@ -1794,7 +1772,7 @@ func TestProductVndkExtDependency(t *testing.T) { nocrt: true, } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.ProductVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") Loading Loading @@ -2349,7 +2327,7 @@ func TestMakeLinkType(t *testing.T) { } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") // native:vndk Loading Loading @@ -3141,7 +3119,7 @@ func TestDataLibsPrebuiltSharedTestLibrary(t *testing.T) { } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") config.TestProductVariables.VndkUseCoreVariant = BoolPtr(true) Loading Loading @@ -3536,7 +3514,7 @@ func TestInstallSharedLibs(t *testing.T) { } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) ctx := testCcWithConfig(t, config) hostBin := ctx.ModuleForTests("bin", config.BuildOSTarget.String()).Description("install") Loading
cc/genrule_test.go +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ func TestArchGenruleCmd(t *testing.T) { }, } ` config := android.TestArchConfig(buildDir, nil, bp, fs) config := android.TestArchConfig(t.TempDir(), nil, bp, fs) ctx := testGenruleContext(config) Loading
cc/library_test.go +2 −2 Original line number Diff line number Diff line Loading @@ -199,7 +199,7 @@ func TestStubsVersions(t *testing.T) { }, } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.Platform_version_active_codenames = []string{"R"} ctx := testCcWithConfig(t, config) Loading @@ -222,7 +222,7 @@ func TestStubsVersions_NotSorted(t *testing.T) { }, } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.Platform_version_active_codenames = []string{"R"} testCcErrorWithConfig(t, `"libfoo" .*: versions: not sorted`, config) } Loading
cc/vendor_snapshot_test.go +15 −15 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ func TestVendorSnapshotCapture(t *testing.T) { symbol_file: "", } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") ctx := testCcWithConfig(t, config) Loading @@ -94,7 +94,7 @@ func TestVendorSnapshotCapture(t *testing.T) { // Check Vendor snapshot output. snapshotDir := "vendor-snapshot" snapshotVariantPath := filepath.Join(buildDir, snapshotDir, "arm64") snapshotVariantPath := filepath.Join("out/soong", snapshotDir, "arm64") snapshotSingleton := ctx.SingletonForTests("vendor-snapshot") var jsonFiles []string Loading Loading @@ -212,7 +212,7 @@ func TestVendorSnapshotDirected(t *testing.T) { nocrt: true, } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") config.TestProductVariables.DirectedVendorSnapshot = true Loading @@ -224,7 +224,7 @@ func TestVendorSnapshotDirected(t *testing.T) { // Check Vendor snapshot output. snapshotDir := "vendor-snapshot" snapshotVariantPath := filepath.Join(buildDir, snapshotDir, "arm64") snapshotVariantPath := filepath.Join("out/soong", snapshotDir, "arm64") snapshotSingleton := ctx.SingletonForTests("vendor-snapshot") var includeJsonFiles []string Loading Loading @@ -516,7 +516,7 @@ func TestVendorSnapshotUse(t *testing.T) { "vndk/libvndk.so": nil, } config := TestConfig(buildDir, android.Android, nil, "", mockFS) config := TestConfig(t.TempDir(), android.Android, nil, "", mockFS) config.TestProductVariables.DeviceVndkVersion = StringPtr("BOARD") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") ctx := CreateTestContext(config) Loading Loading @@ -628,7 +628,7 @@ func TestVendorSnapshotSanitizer(t *testing.T) { }, } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("BOARD") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") ctx := testCcWithConfig(t, config) Loading Loading @@ -707,7 +707,7 @@ func TestVendorSnapshotExclude(t *testing.T) { "device/vendor.cpp": nil, } config := TestConfig(buildDir, android.Android, nil, "", mockFS) config := TestConfig(t.TempDir(), android.Android, nil, "", mockFS) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") ctx := CreateTestContext(config) Loading @@ -730,7 +730,7 @@ func TestVendorSnapshotExclude(t *testing.T) { // Verify the content of the vendor snapshot. snapshotDir := "vendor-snapshot" snapshotVariantPath := filepath.Join(buildDir, snapshotDir, "arm64") snapshotVariantPath := filepath.Join("out/soong", snapshotDir, "arm64") snapshotSingleton := ctx.SingletonForTests("vendor-snapshot") var includeJsonFiles []string Loading Loading @@ -799,7 +799,7 @@ func TestVendorSnapshotExcludeInVendorProprietaryPathErrors(t *testing.T) { "device/vendor.cpp": nil, } config := TestConfig(buildDir, android.Android, nil, "", mockFS) config := TestConfig(t.TempDir(), android.Android, nil, "", mockFS) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") ctx := CreateTestContext(config) Loading Loading @@ -873,7 +873,7 @@ func TestRecoverySnapshotCapture(t *testing.T) { recovery_available: true, } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.RecoverySnapshotVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") ctx := testCcWithConfig(t, config) Loading @@ -881,7 +881,7 @@ func TestRecoverySnapshotCapture(t *testing.T) { // Check Recovery snapshot output. snapshotDir := "recovery-snapshot" snapshotVariantPath := filepath.Join(buildDir, snapshotDir, "arm64") snapshotVariantPath := filepath.Join("out/soong", snapshotDir, "arm64") snapshotSingleton := ctx.SingletonForTests("recovery-snapshot") var jsonFiles []string Loading Loading @@ -991,7 +991,7 @@ func TestRecoverySnapshotExclude(t *testing.T) { "device/recovery.cpp": nil, } config := TestConfig(buildDir, android.Android, nil, "", mockFS) config := TestConfig(t.TempDir(), android.Android, nil, "", mockFS) config.TestProductVariables.RecoverySnapshotVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") ctx := CreateTestContext(config) Loading @@ -1014,7 +1014,7 @@ func TestRecoverySnapshotExclude(t *testing.T) { // Verify the content of the recovery snapshot. snapshotDir := "recovery-snapshot" snapshotVariantPath := filepath.Join(buildDir, snapshotDir, "arm64") snapshotVariantPath := filepath.Join("out/soong", snapshotDir, "arm64") snapshotSingleton := ctx.SingletonForTests("recovery-snapshot") var includeJsonFiles []string Loading Loading @@ -1091,7 +1091,7 @@ func TestRecoverySnapshotDirected(t *testing.T) { nocrt: true, } ` config := TestConfig(buildDir, android.Android, nil, bp, nil) config := TestConfig(t.TempDir(), android.Android, nil, bp, nil) config.TestProductVariables.DeviceVndkVersion = StringPtr("current") config.TestProductVariables.RecoverySnapshotVersion = StringPtr("current") config.TestProductVariables.Platform_vndk_version = StringPtr("VER") Loading @@ -1104,7 +1104,7 @@ func TestRecoverySnapshotDirected(t *testing.T) { // Check recovery snapshot output. snapshotDir := "recovery-snapshot" snapshotVariantPath := filepath.Join(buildDir, snapshotDir, "arm64") snapshotVariantPath := filepath.Join("out/soong", snapshotDir, "arm64") snapshotSingleton := ctx.SingletonForTests("recovery-snapshot") var includeJsonFiles []string Loading