summaryrefslogtreecommitdiff
path: root/cc/testing.go
diff options
context:
space:
mode:
Diffstat (limited to 'cc/testing.go')
-rw-r--r--cc/testing.go41
1 files changed, 0 insertions, 41 deletions
diff --git a/cc/testing.go b/cc/testing.go
index 3bdc3836f..2aecd5f51 100644
--- a/cc/testing.go
+++ b/cc/testing.go
@@ -15,14 +15,12 @@
package cc
import (
- "encoding/json"
"path/filepath"
"testing"
"android/soong/android"
"android/soong/genrule"
"android/soong/multitree"
- "android/soong/snapshot"
)
func RegisterRequiredBuildComponentsForTest(ctx android.RegistrationContext) {
@@ -702,10 +700,6 @@ func CreateTestContext(config android.Config) *android.TestContext {
ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
ctx.RegisterModuleType("vndk_prebuilt_shared", VndkPrebuiltSharedFactory)
- snapshot.VendorSnapshotImageSingleton.Init(ctx)
- snapshot.RecoverySnapshotImageSingleton.Init(ctx)
- RegisterVendorSnapshotModules(ctx)
- RegisterRecoverySnapshotModules(ctx)
RegisterVndkLibraryTxtTypes(ctx)
ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators)
@@ -759,14 +753,6 @@ func CheckSnapshotRule(t *testing.T, ctx *android.TestContext, singleton android
checkSnapshotIncludeExclude(t, ctx, singleton, moduleName, snapshotFilename, subDir, variant, true, true)
}
-func AssertExcludeFromVendorSnapshotIs(t *testing.T, ctx *android.TestContext, name string, expected bool, variant string) {
- t.Helper()
- m := ctx.ModuleForTests(name, variant).Module().(LinkableInterface)
- if m.ExcludeFromVendorSnapshot() != expected {
- t.Errorf("expected %q ExcludeFromVendorSnapshot to be %t", m.String(), expected)
- }
-}
-
func GetOutputPaths(ctx *android.TestContext, variant string, moduleNames []string) (paths android.Paths) {
for _, moduleName := range moduleNames {
module := ctx.ModuleForTests(moduleName, variant).Module().(*Module)
@@ -775,30 +761,3 @@ func GetOutputPaths(ctx *android.TestContext, variant string, moduleNames []stri
}
return paths
}
-
-func AssertExcludeFromRecoverySnapshotIs(t *testing.T, ctx *android.TestContext, name string, expected bool, variant string) {
- t.Helper()
- m := ctx.ModuleForTests(name, variant).Module().(LinkableInterface)
- if m.ExcludeFromRecoverySnapshot() != expected {
- t.Errorf("expected %q ExcludeFromRecoverySnapshot to be %t", m.String(), expected)
- }
-}
-
-func checkOverrides(t *testing.T, ctx *android.TestContext, singleton android.TestingSingleton, jsonPath string, expected []string) {
- t.Helper()
- out := singleton.MaybeOutput(jsonPath)
- content := android.ContentFromFileRuleForTests(t, ctx, out)
-
- var flags snapshotJsonFlags
- if err := json.Unmarshal([]byte(content), &flags); err != nil {
- t.Errorf("Error while unmarshalling json %q: %s", jsonPath, err.Error())
- return
- }
-
- for _, moduleName := range expected {
- if !android.InList(moduleName, flags.Overrides) {
- t.Errorf("expected %q to be in %q: %q", moduleName, flags.Overrides, content)
- return
- }
- }
-}