diff options
Diffstat (limited to 'android/android_test.go')
-rw-r--r-- | android/android_test.go | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/android/android_test.go b/android/android_test.go index fb82e3765..64ceedc4d 100644 --- a/android/android_test.go +++ b/android/android_test.go @@ -15,10 +15,32 @@ package android import ( + "io/ioutil" "os" "testing" ) +var buildDir string + +func setUp() { + var err error + buildDir, err = ioutil.TempDir("", "android_test") + if err != nil { + panic(err) + } +} + +func tearDown() { + os.RemoveAll(buildDir) +} + func TestMain(m *testing.M) { - os.Exit(m.Run()) + run := func() int { + setUp() + defer tearDown() + + return m.Run() + } + + os.Exit(run()) } |