Share buildDir for android/soong/android tests
There is no need to create a separate buildDir for each test file, use TestMain to create a global one for the package. Test: all soong tests Change-Id: I435ee7aa88b7e0bb8ccc1ba79f82833a7accf3e9
This commit is contained in:
@@ -17,8 +17,6 @@ package android
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -880,12 +878,6 @@ func testPathForModuleSrc(t *testing.T, buildDir string, tests []pathForModuleSr
|
||||
}
|
||||
|
||||
func TestPathsForModuleSrc(t *testing.T) {
|
||||
buildDir, err := ioutil.TempDir("", "soong_paths_for_module_src_test")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(buildDir)
|
||||
|
||||
tests := []pathForModuleSrcTestCase{
|
||||
{
|
||||
name: "path",
|
||||
@@ -966,12 +958,6 @@ func TestPathsForModuleSrc(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPathForModuleSrc(t *testing.T) {
|
||||
buildDir, err := ioutil.TempDir("", "soong_path_for_module_src_test")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(buildDir)
|
||||
|
||||
tests := []pathForModuleSrcTestCase{
|
||||
{
|
||||
name: "path",
|
||||
@@ -1039,12 +1025,6 @@ func TestPathForModuleSrc(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPathsForModuleSrc_AllowMissingDependencies(t *testing.T) {
|
||||
buildDir, err := ioutil.TempDir("", "soong_paths_for_module_src_allow_missing_dependencies_test")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(buildDir)
|
||||
|
||||
config := TestConfig(buildDir, nil)
|
||||
config.TestProductVariables.Allow_missing_dependencies = proptools.BoolPtr(true)
|
||||
|
||||
|
Reference in New Issue
Block a user