Move ART_HOST_TEST_DIR to Android.common_test.mk
I'm improving Kati's re-run detection, and this $(shell echo $$PPID) now
now causes us to reparse all of the makefiles every time, since it
really does change on each execution. But if you aren't running the ART
tests, this doesn't actually get used.
So punt this over to only executing when you're including the test
runner -- it's not ideal, since you'll be reparsing the makefiles every
time you want to run the tests. Depending on the desired behavior, this
should be able to be implemented without depending on the PID of Kati,
or the test runner can be moved out of the build system, since most of
the builds here have moved to Soong now.
Bug: 30947985
Test: Compare build.ninja before and after this change, only change is
the valgrind-test-art-target* targets.
Test: m -j test-art-host
Change-Id: Ibbc0f20e407bf70bce64d3428be5808d78bdaf91
diff --git a/build/Android.common_test.mk b/build/Android.common_test.mk
index 6b7dc09..8124ca3 100644
--- a/build/Android.common_test.mk
+++ b/build/Android.common_test.mk
@@ -19,6 +19,13 @@
include art/build/Android.common_path.mk
+# Directory used for temporary test files on the host.
+ifneq ($(TMPDIR),)
+ART_HOST_TEST_DIR := $(TMPDIR)/test-art-$(shell echo $$PPID)
+else
+ART_HOST_TEST_DIR := /tmp/$(USER)/test-art-$(shell echo $$PPID)
+endif
+
# 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}