Merge "Migrate bpf package to a per test build directory"

This commit is contained in:
Paul Duffin 2021-03-18 08:51:45 +00:00 committed by Gerrit Code Review
commit 21d1b9a52c
1 changed files with 2 additions and 25 deletions

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{