summaryrefslogtreecommitdiff
path: root/bpf/bpf.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-02-24 18:51:54 +0000
committer Paul Duffin <paulduffin@google.com> 2021-03-09 23:07:17 +0000
commit12c7eb8cb1ea6dfeb36e931030fbf5a839cd1f18 (patch)
tree88e55d42814e6db1198770ea6c5ecc7bc13a019f /bpf/bpf.go
parent02a3d65402d7f41cdccfe8be97f076ebf43504f3 (diff)
Support test fixtures in bpf package
Restructures the bpf package test setup code to create FixturePreparer instances for setting up a test fixture and converts the test to use it. Bug: 181070625 Test: m nothing Change-Id: I7c76ed6dc292ca92d76ef95c4167f7ca2d68e1af
Diffstat (limited to 'bpf/bpf.go')
-rw-r--r--bpf/bpf.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/bpf/bpf.go b/bpf/bpf.go
index 8142f10a5..fa1a84d04 100644
--- a/bpf/bpf.go
+++ b/bpf/bpf.go
@@ -26,7 +26,7 @@ import (
)
func init() {
- android.RegisterModuleType("bpf", BpfFactory)
+ registerBpfBuildComponents(android.InitRegistrationContext)
pctx.Import("android/soong/cc/config")
}
@@ -43,6 +43,12 @@ var (
"ccCmd", "cFlags")
)
+func registerBpfBuildComponents(ctx android.RegistrationContext) {
+ ctx.RegisterModuleType("bpf", BpfFactory)
+}
+
+var PrepareForTestWithBpf = android.FixtureRegisterWithContext(registerBpfBuildComponents)
+
// BpfModule interface is used by the apex package to gather information from a bpf module.
type BpfModule interface {
android.Module