diff --git a/sdk/sdk_test.go b/sdk/sdk_test.go index 05d8bdb92..b7da95cae 100644 --- a/sdk/sdk_test.go +++ b/sdk/sdk_test.go @@ -31,7 +31,7 @@ func TestMain(m *testing.M) { os.Exit(0) } - runTestWithBuildDir(m) + os.Exit(m.Run()) } func TestDepNotInRequiredSdks(t *testing.T) { diff --git a/sdk/testing.go b/sdk/testing.go index a5519f8f0..6df402cff 100644 --- a/sdk/testing.go +++ b/sdk/testing.go @@ -16,8 +16,6 @@ package sdk import ( "fmt" - "io/ioutil" - "os" "path/filepath" "strings" "testing" @@ -30,7 +28,7 @@ import ( ) var sdkFixtureFactory = android.NewFixtureFactory( - &buildDir, + nil, apex.PrepareForTestWithApexBuildComponents, cc.PrepareForTestWithCcDefaultModules, genrule.PrepareForTestWithGenRuleBuildComponents, @@ -326,28 +324,3 @@ type snapshotBuildInfo struct { // The final output zip. outputZip string } - -var buildDir string - -func setUp() { - var err error - buildDir, err = ioutil.TempDir("", "soong_sdk_test") - if err != nil { - panic(err) - } -} - -func tearDown() { - _ = os.RemoveAll(buildDir) -} - -func runTestWithBuildDir(m *testing.M) { - run := func() int { - setUp() - defer tearDown() - - return m.Run() - } - - os.Exit(run()) -}