summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-03-18 17:05:11 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2021-03-18 17:05:11 +0000
commitebcb37bab1e74c1d7594d9568105f70c91e2381c (patch)
treeb79daefa6a81b46324bf110770d52365bdbe796b
parentc3f89bece1246e599adbf0232e54f7962277603b (diff)
parentabbf63d650e4a1bf9f497f5a8bd45dbea6a8b930 (diff)
Merge "Migrate sdk package to a per test build directory"
-rw-r--r--sdk/sdk_test.go2
-rw-r--r--sdk/testing.go29
2 files changed, 2 insertions, 29 deletions
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())
-}