Add disabled test-art-host-oat
Change-Id: I33ca0f29301dcd26db46b6b7876090eaf2ddaa70
diff --git a/Android.mk b/Android.mk
index 9b3f771..53d89eb 100644
--- a/Android.mk
+++ b/Android.mk
@@ -26,18 +26,17 @@
build_path := $(LOCAL_PATH)/build
include $(build_path)/Android.common.mk
+########################################################################
+# product targets
include $(build_path)/Android.libart.mk
include $(build_path)/Android.libart-compiler.mk
ifeq ($(ART_USE_LLVM_COMPILER),true)
include $(build_path)/Android.libart-compiler-llvm.mk
endif
include $(build_path)/Android.executable.mk
-include $(build_path)/Android.oattest.mk
+include $(build_path)/Android.oat.mk
-# The *_DEPENDENCIES definitions:
-# - depend on Android.executable.mk above for ART_HOST_EXECUTABLES
-# - depend on Android.oattest.mk above for ART_TEST_DEX_FILES
-# - are needed by Android.gtest.mk below
+# ART_HOST_DEPENDENCIES depends on Android.executable.mk above for ART_HOST_EXECUTABLES
ART_HOST_DEPENDENCIES := $(ART_HOST_EXECUTABLES) $(HOST_OUT_JAVA_LIBRARIES)/core-hostdex.jar
ifeq ($(HOST_OS),linux)
ART_HOST_DEPENDENCIES += $(HOST_OUT_SHARED_LIBRARIES)/libjavacore.so
@@ -46,10 +45,16 @@
endif
ART_TARGET_DEPENDENCIES := $(ART_TARGET_EXECUTABLES) $(TARGET_OUT_JAVA_LIBRARIES)/core.jar $(TARGET_OUT_SHARED_LIBRARIES)/libjavacore.so
-ART_HOST_TEST_DEPENDENCIES := $(ART_HOST_DEPENDENCIES) $(ART_HOST_TEST_EXECUTABLES) $(ART_TEST_DEX_FILES)
-ART_TARGET_TEST_DEPENDENCIES := $(ART_TARGET_DEPENDENCIES) $(ART_TARGET_TEST_EXECUTABLES) $(ART_TEST_DEX_FILES)
+########################################################################
+# test targets
-include $(build_path)/Android.oat.mk
+include $(build_path)/Android.oattest.mk
+
+# The ART_*_TEST_DEPENDENCIES definitions:
+# - depend on Android.oattest.mk above for ART_TEST_*_DEX_FILES
+# - are needed by Android.gtest.mk below
+ART_HOST_TEST_DEPENDENCIES := $(ART_HOST_DEPENDENCIES) $(ART_HOST_TEST_EXECUTABLES) $(ART_TEST_HOST_DEX_FILES) $(HOST_CORE_IMG_OUT)
+ART_TARGET_TEST_DEPENDENCIES := $(ART_TARGET_DEPENDENCIES) $(ART_TARGET_TEST_EXECUTABLES) $(ART_TEST_TARGET_DEX_FILES) $(TARGET_CORE_IMG_OUT)
include $(build_path)/Android.libarttest.mk
include $(build_path)/Android.gtest.mk
@@ -68,32 +73,44 @@
@echo test-art PASSED
.PHONY: test-art-gtest
-test-art-gtest: test-art-host test-art-target-gtest
+test-art-gtest: test-art-host-gtest test-art-target-gtest
@echo test-art-gtest PASSED
-define run-host-tests-with
- $(foreach file,$(sort $(ART_HOST_TEST_EXECUTABLES)),$(1) $(file) &&) true
-endef
+.PHONY: test-art-oat
+test-art-oat: test-art-target-oat # test-art-host-oat
+ @echo test-art-oat PASSED
########################################################################
# host test targets
# "mm test-art-host" to build and run all host tests
.PHONY: test-art-host
-test-art-host: $(ART_HOST_TEST_TARGETS)
+test-art-host: test-art-host-gtest # test-art-host-oat # test-art-host-run-test
@echo test-art-host PASSED
-# "mm valgrind-art-host" to build and run all host tests under valgrind.
-.PHONY: valgrind-art-host
-valgrind-art-host: $(ART_HOST_TEST_DEPENDENCIES)
- $(call run-host-tests-with,valgrind --leak-check=full)
- @echo valgrind-art-host PASSED
+.PHONY: test-art-host-gtest
+test-art-host-gtest: $(ART_HOST_TEST_TARGETS)
+ @echo test-art-host-gtest PASSED
-# "mm tsan-art-host" to build and run all host tests under tsan.
-.PHONY: tsan-art-host
-tsan-art-host: $(ART_HOST_TEST_DEPENDENCIES)
- $(call run-host-tests-with,"tsan")
- @echo tsan-art-host PASSED
+define run-host-gtests-with
+ $(foreach file,$(sort $(ART_HOST_TEST_EXECUTABLES)),$(1) $(file) &&) true
+endef
+
+# "mm valgrind-test-art-host-gtest" to build and run the host gtests under valgrind.
+.PHONY: valgrind-test-art-host-gtest
+valgrind-test-art-host-gtest: $(ART_HOST_TEST_DEPENDENCIES)
+ $(call run-host-gtests-with,valgrind --leak-check=full)
+ @echo valgrind-test-art-host-gtest PASSED
+
+# "mm tsan-test-art-host-gtest" to build and run the host gtests under tsan.
+.PHONY: tsan-test-art-host-gtest
+tsan-test-art-host-gtest: $(ART_HOST_TEST_DEPENDENCIES)
+ $(call run-host-gtests-with,"tsan")
+ @echo tsan-test-art-host-gtest PASSED
+
+.PHONY: test-art-host-oat
+test-art-host-oat: $(ART_TEST_HOST_OAT_TARGETS)
+ @echo test-art-host-oat PASSED
########################################################################
# target test targets
@@ -113,7 +130,7 @@
test-art-target-gtest: $(ART_TARGET_TEST_TARGETS)
.PHONY: test-art-target-oat
-test-art-target-oat: $(ART_TEST_OAT_TARGETS)
+test-art-target-oat: $(ART_TEST_TARGET_OAT_TARGETS)
@echo test-art-target-oat PASSED
define declare-test-art-target-run-test
diff --git a/build/Android.oattest.mk b/build/Android.oattest.mk
index bba51e9..c7617e3 100644
--- a/build/Android.oattest.mk
+++ b/build/Android.oattest.mk
@@ -16,33 +16,46 @@
########################################################################
-ART_TEST_DEX_FILES :=
+ART_TEST_TARGET_DEX_FILES :=
+ART_TEST_HOST_DEX_FILES :=
# $(1): module prefix
# $(2): input test directory
-# $(3): output module path
+# $(3): target output module path (default module path is used on host)
define build-art-test-dex
include $(CLEAR_VARS)
LOCAL_MODULE := $(1)-$(2)
LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := $(call all-java-files-under, test/$(2))
- LOCAL_JAVA_LIBRARIES := core
+ LOCAL_JAVA_LIBRARIES := $(TARGET_CORE_JARS)
LOCAL_NO_STANDARD_LIBRARIES := true
LOCAL_MODULE_PATH := $(3)
LOCAL_DEX_PREOPT_IMAGE := $(TARGET_CORE_IMG_OUT)
include $(BUILD_JAVA_LIBRARY)
- ART_TEST_DEX_FILES += $(3)/$$(LOCAL_MODULE).jar
+ ART_TEST_TARGET_DEX_FILES += $(3)/$$(LOCAL_MODULE).jar
+
+ include $(CLEAR_VARS)
+ LOCAL_MODULE := $(1)-$(2)
+ LOCAL_MODULE_TAGS := tests
+ LOCAL_SRC_FILES := $(call all-java-files-under, test/$(2))
+ LOCAL_JAVA_LIBRARIES := $(HOST_CORE_JARS)
+ LOCAL_NO_STANDARD_LIBRARIES := true
+ LOCAL_DEX_PREOPT_IMAGE := $(HOST_CORE_IMG_OUT)
+ LOCAL_BUILD_HOST_DEX := true
+ include $(BUILD_HOST_JAVA_LIBRARY)
+ ART_TEST_HOST_DEX_FILES += $$(LOCAL_MODULE_PATH)/$$(LOCAL_MODULE).jar
endef
$(foreach dir,$(TEST_DEX_DIRECTORIES), $(eval $(call build-art-test-dex,art-test-dex,$(dir),$(ART_NATIVETEST_OUT))))
$(foreach dir,$(TEST_OAT_DIRECTORIES), $(eval $(call build-art-test-dex,oat-test-dex,$(dir),$(ART_TEST_OUT))))
########################################################################
-ART_TEST_OAT_TARGETS :=
+ART_TEST_TARGET_OAT_TARGETS :=
+ART_TEST_HOST_OAT_TARGETS :=
# $(1): directory
# $(2): arguments
-define declare-test-art-target
+define declare-test-art-oat-targets
.PHONY: test-art-target-oat-$(1)
test-art-target-oat-$(1): $(ART_TEST_OUT)/oat-test-dex-$(1).jar test-art-target-sync
adb shell touch $(ART_TEST_DIR)/test-art-target-oat-$(1)
@@ -51,8 +64,19 @@
$(hide) (adb pull $(ART_TEST_DIR)/test-art-target-oat-$(1) /tmp/ && echo test-art-target-oat-$(1) PASSED) || (echo test-art-target-oat-$(1) FAILED && exit 1)
$(hide) rm /tmp/test-art-target-oat-$(1)
-ART_TEST_OAT_TARGETS += test-art-target-oat-$(1)
+.PHONY: test-art-host-oat-$(1)
+test-art-host-oat-$(1): $(ART_TEST_OUT)/oat-test-dex-$(1).jar $(HOST_CORE_IMG_OUT)
+ mkdir -p /tmp/android-data/test-art-host-oat-$(1)
+ ANDROID_DATA=/tmp/android-data/test-art-host-oat-$(1) \
+ ANDROID_ROOT=$(HOST_OUT) \
+ LD_LIBRARY_PATH=$(HOST_OUT_SHARED_LIBRARIES) \
+ oatexecd -Ximage:$(shell pwd)/$(HOST_CORE_IMG_OUT) -classpath $(ART_TEST_OUT)/oat-test-dex-$(1).jar -Djava.library.path=$(ART_TEST_OUT) $(1) $(2)
+ rm -r /tmp/android-data/test-art-host-oat-$(1)
+
+
+ART_TEST_TARGET_OAT_TARGETS += test-art-target-oat-$(1)
+ART_TEST_HOST_OAT_TARGETS += test-art-host-oat-$(1)
endef
-$(foreach dir,$(TEST_OAT_DIRECTORIES), $(eval $(call declare-test-art-target,$(dir))))
+$(foreach dir,$(TEST_OAT_DIRECTORIES), $(eval $(call declare-test-art-oat-targets,$(dir))))
########################################################################
diff --git a/src/common_test.h b/src/common_test.h
index 29ed57c..d8832f6 100644
--- a/src/common_test.h
+++ b/src/common_test.h
@@ -414,10 +414,12 @@
CHECK(name != NULL);
std::string filename;
if (is_host_) {
- // on the host, just read target dex file
- filename += getenv("ANDROID_PRODUCT_OUT");
+ filename += getenv("ANDROID_HOST_OUT");
+ filename += "/framework/";
+ } else {
+ filename += "/data/nativetest/art/";
}
- filename += "/data/nativetest/art/art-test-dex-";
+ filename += "art-test-dex-";
filename += name;
filename += ".jar";
const DexFile* dex_file = DexFile::Open(filename, filename);
diff --git a/src/heap.cc b/src/heap.cc
index 13603d9..5a19d28 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -55,6 +55,9 @@
const std::string boot_class_path_string(Runtime::Current()->GetBootClassPathString());
std::vector<std::string> boot_class_path;
Split(boot_class_path_string, ':', boot_class_path);
+ if (boot_class_path.empty()) {
+ LOG(FATAL) << "Failed to generate image because no boot class path specified";
+ }
std::vector<char*> arg_vector;