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.
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 := \
#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"
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;
filename += getenv("ANDROID_HOST_OUT");
filename += "/framework/";
} else {
- filename += "/data/nativetest/art/";
+ filename += ART_TARGET_NATIVETEST_DIR_STRING;
}
filename += "art-gtest-";
filename += name;