Migrate android package to a per test build directory

Bug: 182885307
Test: m nothing
Change-Id: I6b868bacc36be1f6768fbb2fb1d7ed4ad6e4118c
This commit is contained in:
Paul Duffin
2021-03-17 00:13:36 +00:00
parent d518b7e2f2
commit 1afa515929

View File

@@ -15,34 +15,12 @@
package android
import (
"io/ioutil"
"os"
"testing"
)
var buildDir string
func setUp() {
var err error
buildDir, err = ioutil.TempDir("", "soong_android_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 emptyTestFixtureFactory = NewFixtureFactory(&buildDir)
var emptyTestFixtureFactory = NewFixtureFactory(nil)