summaryrefslogtreecommitdiff
path: root/cc/testing.go
diff options
context:
space:
mode:
Diffstat (limited to 'cc/testing.go')
-rw-r--r--cc/testing.go46
1 files changed, 10 insertions, 36 deletions
diff --git a/cc/testing.go b/cc/testing.go
index b9d84f6cb..19513e357 100644
--- a/cc/testing.go
+++ b/cc/testing.go
@@ -20,6 +20,7 @@ import (
"android/soong/android"
"android/soong/genrule"
+ "android/soong/snapshot"
)
func RegisterRequiredBuildComponentsForTest(ctx android.RegistrationContext) {
@@ -44,9 +45,6 @@ func GatherRequiredDepsForTest(oses ...android.OsType) string {
supportLinuxBionic := false
for _, os := range oses {
- if os == android.Fuchsia {
- ret += withFuchsiaModules()
- }
if os == android.Windows {
ret += withWindowsModules()
}
@@ -471,19 +469,6 @@ func withWindowsModules() string {
`
}
-func withFuchsiaModules() string {
- return `
- cc_library {
- name: "libbioniccompat",
- stl: "none",
- }
- cc_library {
- name: "libcompiler_rt",
- stl: "none",
- }
- `
-}
-
func withLinuxBionic() string {
return `
cc_binary {
@@ -625,21 +610,15 @@ var PrepareForTestOnLinuxBionic = android.GroupFixturePreparers(
android.FixtureOverrideTextFile(linuxBionicDefaultsPath, withLinuxBionic()),
)
-// The preparer to include if running a cc related test for fuchsia.
-var PrepareForTestOnFuchsia = android.GroupFixturePreparers(
- // Place the default cc test modules for fuschia in a location that will not conflict with default
- // test modules defined by other packages.
- android.FixtureAddTextFile("defaults/cc/fuschia/Android.bp", withFuchsiaModules()),
- android.PrepareForTestSetDeviceToFuchsia,
-)
-
// This adds some additional modules and singletons which might negatively impact the performance
// of tests so they are not included in the PrepareForIntegrationTestWithCc.
var PrepareForTestWithCcIncludeVndk = android.GroupFixturePreparers(
PrepareForIntegrationTestWithCc,
android.FixtureRegisterWithContext(func(ctx android.RegistrationContext) {
- VendorSnapshotImageSingleton.Init(ctx)
- recoverySnapshotImageSingleton.init(ctx)
+ snapshot.VendorSnapshotImageSingleton.Init(ctx)
+ snapshot.RecoverySnapshotImageSingleton.Init(ctx)
+ RegisterVendorSnapshotModules(ctx)
+ RegisterRecoverySnapshotModules(ctx)
ctx.RegisterSingletonType("vndk-snapshot", VndkSnapshotSingleton)
}),
)
@@ -663,14 +642,7 @@ func TestConfig(buildDir string, os android.OsType, env map[string]string,
mockFS[k] = v
}
- var config android.Config
- if os == android.Fuchsia {
- panic("Fuchsia not supported use test fixture instead")
- } else {
- config = android.TestArchConfig(buildDir, env, bp, mockFS)
- }
-
- return config
+ return android.TestArchConfig(buildDir, env, bp, mockFS)
}
// CreateTestContext is the legacy way of creating a TestContext for testing cc modules.
@@ -687,8 +659,10 @@ func CreateTestContext(config android.Config) *android.TestContext {
ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
ctx.RegisterModuleType("vndk_prebuilt_shared", VndkPrebuiltSharedFactory)
- VendorSnapshotImageSingleton.Init(ctx)
- recoverySnapshotImageSingleton.init(ctx)
+ snapshot.VendorSnapshotImageSingleton.Init(ctx)
+ snapshot.RecoverySnapshotImageSingleton.Init(ctx)
+ RegisterVendorSnapshotModules(ctx)
+ RegisterRecoverySnapshotModules(ctx)
ctx.RegisterSingletonType("vndk-snapshot", VndkSnapshotSingleton)
RegisterVndkLibraryTxtTypes(ctx)