Migrate bpf package to a per test build directory

Bug: 182885307
Test: m nothing
Change-Id: I0ee9575af056057ca37831a3afebba2be1e54d27
This commit is contained in:
Paul Duffin
2021-03-16 13:36:55 +00:00
parent 45a4971808
commit 854d661572

View File

@@ -15,7 +15,6 @@
package bpf
import (
"io/ioutil"
"os"
"testing"
@@ -23,34 +22,12 @@ import (
"android/soong/cc"
)
var buildDir string
func setUp() {
var err error
buildDir, err = ioutil.TempDir("", "genrule_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 bpfFactory = android.NewFixtureFactory(
&buildDir,
nil,
cc.PrepareForTestWithCcDefaultModules,
android.FixtureMergeMockFs(
map[string][]byte{