aboutsummaryrefslogtreecommitdiff
path: root/src/com/android/tradefed
diff options
context:
space:
mode:
authormikehoran <mikehoran@google.com>2017-09-01 02:37:38 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-09-01 02:37:38 +0000
commit2b1f1c5391dec3c2a5a394e87522db3c1e9a94b7 (patch)
tree8532926943e5632230b183e3e738e25189a73b16 /src/com/android/tradefed
parentad39b14bcbcd30de5a61b8c7dc4808069f95dada (diff)
parent49d8c0f10360df28819a02c328210dfab9d9b473 (diff)
downloadtradefederation-2b1f1c5391dec3c2a5a394e87522db3c1e9a94b7.tar.gz
Merge "Add support for android host test cases." into oc-dev am: 9a9c8f69bf
am: 49d8c0f103 Change-Id: I20c2b097e6126ef264ec6f55d0554db7396e6e30
Diffstat (limited to 'src/com/android/tradefed')
-rw-r--r--src/com/android/tradefed/config/ConfigurationFactory.java5
-rw-r--r--src/com/android/tradefed/util/SystemUtil.java14
2 files changed, 10 insertions, 9 deletions
diff --git a/src/com/android/tradefed/config/ConfigurationFactory.java b/src/com/android/tradefed/config/ConfigurationFactory.java
index 92f8a6d4b..d200b1f6c 100644
--- a/src/com/android/tradefed/config/ConfigurationFactory.java
+++ b/src/com/android/tradefed/config/ConfigurationFactory.java
@@ -220,6 +220,7 @@ public class ConfigurationFactory implements IConfigurationFactory {
for (String configFileName : possibleConfigFileNames) {
File config = FileUtil.findFile(testCasesDir, configFileName);
if (config != null) {
+ CLog.d("Using config: %s/%s", testCasesDir.getAbsoluteFile(), configFileName);
return config;
}
}
@@ -272,9 +273,7 @@ public class ConfigurationFactory implements IConfigurationFactory {
} else {
if (templateMap != null) {
// Clearing the map before returning the cached config to
- // avoid seeing them as
- // unused.
- CLog.d("Using cached configuration, ensuring map is clean.");
+ // avoid seeing them as unused.
templateMap.clear();
}
}
diff --git a/src/com/android/tradefed/util/SystemUtil.java b/src/com/android/tradefed/util/SystemUtil.java
index b1e9284ef..727ad9108 100644
--- a/src/com/android/tradefed/util/SystemUtil.java
+++ b/src/com/android/tradefed/util/SystemUtil.java
@@ -25,9 +25,8 @@ import com.google.common.annotations.VisibleForTesting;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
+
/** Utility class for making system calls. */
public class SystemUtil {
@@ -63,14 +62,17 @@ public class SystemUtil {
/** Get a list of {@link File} pointing to tests directories external to Tradefed. */
public static List<File> getExternalTestCasesDirs() {
List<File> testCasesDirs = new ArrayList<File>();
- // TODO(b/36782030): Add ENV_ANDROID_HOST_OUT_TESTCASES back to the list.
- Set<String> testCasesDirNames =
- new HashSet<String>(
- Arrays.asList(singleton.getEnv(ENV_ANDROID_TARGET_OUT_TESTCASES)));
+ // TODO(b/36782030): Support running both HOST and TARGET tests.
+ List<String> testCasesDirNames =
+ // List order matters. ConfigurationFactory caller uses first dir with test config.
+ Arrays.asList(
+ singleton.getEnv(ENV_ANDROID_TARGET_OUT_TESTCASES),
+ singleton.getEnv(ENV_ANDROID_HOST_OUT_TESTCASES));
for (String testCasesDirName : testCasesDirNames) {
if (testCasesDirName != null) {
File dir = new File(testCasesDirName);
if (dir.exists() && dir.isDirectory()) {
+ CLog.d("Found test case dir: %s", testCasesDirName);
testCasesDirs.add(dir);
} else {
CLog.w(