summaryrefslogtreecommitdiff
path: root/android/test_config.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/test_config.go')
-rw-r--r--android/test_config.go17
1 files changed, 14 insertions, 3 deletions
diff --git a/android/test_config.go b/android/test_config.go
index 3609e6b78..5d79df099 100644
--- a/android/test_config.go
+++ b/android/test_config.go
@@ -23,8 +23,7 @@ import (
"github.com/google/blueprint/proptools"
)
-// TestConfig returns a Config object for testing.
-func TestConfig(buildDir string, env map[string]string, bp string, fs map[string][]byte) Config {
+func initTestConfig(buildDir string, env map[string]string) *config {
envCopy := make(map[string]string)
for k, v := range env {
envCopy[k] = v
@@ -58,6 +57,7 @@ func TestConfig(buildDir string, env map[string]string, bp string, fs map[string
soongOutDir: filepath.Join(buildDir, "soong"),
captureBuild: true,
env: envCopy,
+ OncePer: &OncePer{},
// Set testAllowNonExistentPaths so that test contexts don't need to specify every path
// passed to PathForSource or PathForModuleSrc.
@@ -69,10 +69,21 @@ func TestConfig(buildDir string, env map[string]string, bp string, fs map[string
config: config,
}
config.TestProductVariables = &config.productVariables
+ config.deviceNameToInstall = config.TestProductVariables.DeviceName
+
+ determineBuildOS(config)
+
+ return config
+}
+
+// TestConfig returns a Config object for testing.
+func TestConfig(buildDir string, env map[string]string, bp string, fs map[string][]byte) Config {
+ config := initTestConfig(buildDir, env)
config.mockFileSystem(bp, fs)
- determineBuildOS(config)
+ config.genericConfig = initTestConfig(buildDir, env)
+ overrideGenericConfig(config)
return Config{config}
}