summaryrefslogtreecommitdiff
path: root/android/testing.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2024-12-02 22:45:48 +0000
committer Spandan Das <spandandas@google.com> 2024-12-02 22:48:14 +0000
commit45e4001f7a4c4e30e237a8f8a00d9b352785f31a (patch)
treefe84efa45307030edf0c867c0e6d5c9ae5617ae8 /android/testing.go
parentf0eabbf94ffa8acf87e88822ec85c162f33b973e (diff)
Move withNativeBridgeEnabled to build/soong/android
This fixture creates the setup for native bridge targets. Moving this to android package reduces code duplication. Bug: 376873507 Test: go test ./android ./apex ./fsgen Change-Id: I7e14b623ee4da803a7f78adeeeb18b3ad7a0622d
Diffstat (limited to 'android/testing.go')
-rw-r--r--android/testing.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/android/testing.go b/android/testing.go
index f243e81dd..765839ffa 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -190,6 +190,26 @@ func PrepareForTestWithBuildFlag(flag, value string) FixturePreparer {
})
}
+// PrepareForNativeBridgeEnabled sets configuration with targets including:
+// - X86_64 (primary)
+// - X86 (secondary)
+// - Arm64 on X86_64 (native bridge)
+// - Arm on X86 (native bridge)
+var PrepareForNativeBridgeEnabled = FixtureModifyConfig(
+ func(config Config) {
+ config.Targets[Android] = []Target{
+ {Os: Android, Arch: Arch{ArchType: X86_64, ArchVariant: "silvermont", Abi: []string{"arm64-v8a"}},
+ NativeBridge: NativeBridgeDisabled, NativeBridgeHostArchName: "", NativeBridgeRelativePath: ""},
+ {Os: Android, Arch: Arch{ArchType: X86, ArchVariant: "silvermont", Abi: []string{"armeabi-v7a"}},
+ NativeBridge: NativeBridgeDisabled, NativeBridgeHostArchName: "", NativeBridgeRelativePath: ""},
+ {Os: Android, Arch: Arch{ArchType: Arm64, ArchVariant: "armv8-a", Abi: []string{"arm64-v8a"}},
+ NativeBridge: NativeBridgeEnabled, NativeBridgeHostArchName: "x86_64", NativeBridgeRelativePath: "arm64"},
+ {Os: Android, Arch: Arch{ArchType: Arm, ArchVariant: "armv7-a-neon", Abi: []string{"armeabi-v7a"}},
+ NativeBridge: NativeBridgeEnabled, NativeBridgeHostArchName: "x86", NativeBridgeRelativePath: "arm"},
+ }
+ },
+)
+
func NewTestArchContext(config Config) *TestContext {
ctx := NewTestContext(config)
ctx.preDeps = append(ctx.preDeps, registerArchMutator)