summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-07-27 21:56:42 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-07-24 20:55:36 +0000
commit98cc1e552c2ccbe5d51bc81d49e79119280f5416 (patch)
tree4e6cf97184bc4a0646ef7a9afaa32ec731691d8e
parentb3bf7afc4288f97f9b591d19f03362e0577ed0ec (diff)
parent1fe5e5cce85a3cdc64a8d226a8ef4e6134c2b9eb (diff)
downloadart-98cc1e552c2ccbe5d51bc81d49e79119280f5416.tar.gz
art-98cc1e552c2ccbe5d51bc81d49e79119280f5416.tar.bz2
art-98cc1e552c2ccbe5d51bc81d49e79119280f5416.zip
Merge "ART: Fix target test paths"
-rw-r--r--build/Android.common_path.mk6
-rw-r--r--build/Android.common_test.mk4
-rw-r--r--runtime/common_runtime_test.cc14
3 files changed, 22 insertions, 2 deletions
diff --git a/build/Android.common_path.mk b/build/Android.common_path.mk
index bd1e8aa6a..10695b6be 100644
--- a/build/Android.common_path.mk
+++ b/build/Android.common_path.mk
@@ -23,7 +23,11 @@ include art/build/Android.common.mk
ART_TARGET_DALVIK_CACHE_DIR := /data/dalvik-cache
# Directory used for gtests on device.
-ART_TARGET_NATIVETEST_DIR := /data/nativetest/art
+# $(TARGET_OUT_DATA_NATIVE_TESTS) will evaluate to the nativetest directory in the target part on
+# the host, so we can strip everything but the directory to find out whether it is "nativetest" or
+# "nativetest64."
+ART_TARGET_NATIVETEST_DIR := /data/$(notdir $(TARGET_OUT_DATA_NATIVE_TESTS))/art
+
ART_TARGET_NATIVETEST_OUT := $(TARGET_OUT_DATA_NATIVE_TESTS)/art
# Directory used for oat tests on device.
diff --git a/build/Android.common_test.mk b/build/Android.common_test.mk
index 1ec0c76f3..196796895 100644
--- a/build/Android.common_test.mk
+++ b/build/Android.common_test.mk
@@ -19,6 +19,10 @@ ANDROID_COMMON_TEST_MK = true
include art/build/Android.common_path.mk
+# We need to set a define for the nativetest dir so that common_runtime_test will know the right
+# path. (The problem is being a 32b test on 64b device, which is still located in nativetest64).
+ART_TARGET_CFLAGS += -DART_TARGET_NATIVETEST_DIR=${ART_TARGET_NATIVETEST_DIR}
+
# List of known broken tests that we won't attempt to execute. The test name must be the full
# rule name such as test-art-host-oat-optimizing-HelloWorld64.
ART_TEST_KNOWN_BROKEN := \
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc
index 2826f890f..a43a645c8 100644
--- a/runtime/common_runtime_test.cc
+++ b/runtime/common_runtime_test.cc
@@ -22,6 +22,7 @@
#include <ScopedLocalRef.h>
#include "../../external/icu/icu4c/source/common/unicode/uvernum.h"
+#include "base/macros.h"
#include "base/logging.h"
#include "base/stl_util.h"
#include "base/stringprintf.h"
@@ -272,6 +273,17 @@ std::string CommonRuntimeTest::GetTestAndroidRoot() {
return GetAndroidRoot();
}
+// Check that for target builds we have ART_TARGET_NATIVETEST_DIR set.
+#ifdef ART_TARGET
+#ifndef ART_TARGET_NATIVETEST_DIR
+#error "ART_TARGET_NATIVETEST_DIR not set."
+#endif
+// Wrap it as a string literal.
+#define ART_TARGET_NATIVETEST_DIR_STRING STRINGIFY(ART_TARGET_NATIVETEST_DIR) "/"
+#else
+#define ART_TARGET_NATIVETEST_DIR_STRING ""
+#endif
+
std::vector<const DexFile*> CommonRuntimeTest::OpenTestDexFiles(const char* name) {
CHECK(name != nullptr);
std::string filename;
@@ -279,7 +291,7 @@ std::vector<const DexFile*> CommonRuntimeTest::OpenTestDexFiles(const char* name
filename += getenv("ANDROID_HOST_OUT");
filename += "/framework/";
} else {
- filename += "/data/nativetest/art/";
+ filename += ART_TARGET_NATIVETEST_DIR_STRING;
}
filename += "art-gtest-";
filename += name;