aboutsummaryrefslogtreecommitdiff
path: root/src/com/android/tradefed
diff options
context:
space:
mode:
authormikehoran <mikehoran@google.com>2017-09-01 02:34:08 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-09-01 02:34:08 +0000
commit49d8c0f10360df28819a02c328210dfab9d9b473 (patch)
tree1517a3fe93c0c23a2286c5a2262e50cdf32b8498 /src/com/android/tradefed
parent47f1e0a698af35cfb60d7490d4674c3ac0eae3b9 (diff)
parent9a9c8f69bfdd5aae59dae4e86413399198e7cc9d (diff)
downloadtradefederation-49d8c0f10360df28819a02c328210dfab9d9b473.tar.gz
Merge "Add support for android host test cases." into oc-dev
am: 9a9c8f69bf Change-Id: Icf0bcd7161a41fd3d5c7249d516199619554f87f
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(