Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1afa5159 authored by Paul Duffin's avatar Paul Duffin
Browse files

Migrate android package to a per test build directory

Bug: 182885307
Test: m nothing
Change-Id: I6b868bacc36be1f6768fbb2fb1d7ed4ad6e4118c
parent d518b7e2
Loading
Loading
Loading
Loading
+2 −24
Original line number Diff line number Diff line
@@ -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)