aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDmitriy Ivanov2014-12-02 18:02:13 -0600
committerGerrit Code Review2014-12-02 18:02:13 -0600
commit6995c1dcb5a9ad77a54d950fc24f5aba00909b69 (patch)
tree75233907d7f517dc5b336a08c443dcc60c33813b /tests
parent432f763c0c370870b653537342aff87fac862d97 (diff)
parent06b1b8ceac992b861cc8a4fe21a3f8d5a40bb99c (diff)
downloadplatform-bionic-6995c1dcb5a9ad77a54d950fc24f5aba00909b69.tar.gz
platform-bionic-6995c1dcb5a9ad77a54d950fc24f5aba00909b69.tar.xz
platform-bionic-6995c1dcb5a9ad77a54d950fc24f5aba00909b69.zip
Merge "Extract bionic-prepare-run-on-host to inc file."
Diffstat (limited to 'tests')
-rw-r--r--tests/Android.mk42
1 files changed, 10 insertions, 32 deletions
diff --git a/tests/Android.mk b/tests/Android.mk
index 6010def1..93ab9bde 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -373,14 +373,6 @@ include $(BUILD_STATIC_LIBRARY)
373# Host glibc tests. 373# Host glibc tests.
374# ----------------------------------------------------------------------------- 374# -----------------------------------------------------------------------------
375 375
376ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm mips x86))
377LINKER = linker64
378NATIVE_TEST_SUFFIX=64
379else
380LINKER = linker
381NATIVE_TEST_SUFFIX=32
382endif
383
384# gtest needs ANDROID_DATA/local/tmp for death test output. 376# gtest needs ANDROID_DATA/local/tmp for death test output.
385# Make sure to create ANDROID_DATA/local/tmp if doesn't exist. 377# Make sure to create ANDROID_DATA/local/tmp if doesn't exist.
386# Use the current target out directory as ANDROID_DATA. 378# Use the current target out directory as ANDROID_DATA.
@@ -389,46 +381,32 @@ bionic-unit-tests-glibc-run: bionic-unit-tests-glibc
389 mkdir -p $(TARGET_OUT_DATA)/local/tmp 381 mkdir -p $(TARGET_OUT_DATA)/local/tmp
390 ANDROID_DATA=$(TARGET_OUT_DATA) \ 382 ANDROID_DATA=$(TARGET_OUT_DATA) \
391 ANDROID_ROOT=$(TARGET_OUT) \ 383 ANDROID_ROOT=$(TARGET_OUT) \
392 $(HOST_OUT_EXECUTABLES)/bionic-unit-tests-glibc$(NATIVE_TEST_SUFFIX) $(BIONIC_TEST_FLAGS) 384 $(HOST_OUT_EXECUTABLES)/bionic-unit-tests-glibc64 $(BIONIC_TEST_FLAGS)
393 385
394# ----------------------------------------------------------------------------- 386# -----------------------------------------------------------------------------
395# Run the unit tests built against x86 bionic on an x86 host. 387# Run the unit tests built against x86 bionic on an x86 host.
396# ----------------------------------------------------------------------------- 388# -----------------------------------------------------------------------------
397 389
390include $(LOCAL_PATH)/../build/run-on-host.mk
391
398ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64)) 392ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
399# gtest needs ANDROID_DATA/local/tmp for death test output.
400# Make sure to create ANDROID_DATA/local/tmp if doesn't exist.
401# bionic itself should always work relative to ANDROID_DATA or ANDROID_ROOT.
402# BIONIC_TEST_FLAGS is either empty or it comes from the user. 393# BIONIC_TEST_FLAGS is either empty or it comes from the user.
403bionic-unit-tests-run-on-host-prepare: $(TARGET_OUT_EXECUTABLES)/$(LINKER) $(TARGET_OUT)/etc/hosts $(TARGET_OUT_EXECUTABLES)/sh 394bionic-unit-tests-run-on-host32: bionic-unit-tests bionic-prepare-run-on-host
404 if [ ! -d /system ]; then \
405 echo "Attempting to create /system"; \
406 sudo mkdir -p -m 0777 /system; \
407 fi
408 mkdir -p $(TARGET_OUT_DATA)/local/tmp
409 ln -fs `realpath $(TARGET_OUT)/bin` /system/
410 ln -fs `realpath $(TARGET_OUT)/etc` /system/
411 ln -fs `realpath $(TARGET_OUT)/lib` /system/
412 if [ -d "$(TARGET_OUT)/lib64" ]; then \
413 ln -fs `realpath $(TARGET_OUT)/lib64` /system/; \
414 fi
415
416bionic-unit-tests-run-on-host: bionic-unit-tests bionic-unit-tests-run-on-host-prepare
417 ANDROID_DATA=$(TARGET_OUT_DATA) \ 395 ANDROID_DATA=$(TARGET_OUT_DATA) \
418 ANDROID_DNS_MODE=local \ 396 ANDROID_DNS_MODE=local \
419 ANDROID_ROOT=$(TARGET_OUT) \ 397 ANDROID_ROOT=$(TARGET_OUT) \
420 $(TARGET_OUT_DATA_NATIVE_TESTS)/bionic-unit-tests/bionic-unit-tests$(NATIVE_TEST_SUFFIX) $(BIONIC_TEST_FLAGS) 398 $(TARGET_OUT_DATA)/nativetest/bionic-unit-tests/bionic-unit-tests32 $(BIONIC_TEST_FLAGS)
421endif
422 399
423ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86_64)) 400ifeq ($(TARGET_IS_64_BIT),true)
424# add target to run lp32 tests 401# add target to run lp64 tests
425bionic-unit-tests-run-on-host32: bionic-unit-tests_32 bionic-unit-tests-run-on-host-prepare 402bionic-unit-tests-run-on-host64: bionic-unit-tests bionic-prepare-run-on-host
426 ANDROID_DATA=$(TARGET_OUT_DATA) \ 403 ANDROID_DATA=$(TARGET_OUT_DATA) \
427 ANDROID_DNS_MODE=local \ 404 ANDROID_DNS_MODE=local \
428 ANDROID_ROOT=$(TARGET_OUT) \ 405 ANDROID_ROOT=$(TARGET_OUT) \
429 $(2ND_TARGET_OUT_DATA_NATIVE_TESTS)/bionic-unit-tests/bionic-unit-tests32 $(BIONIC_TEST_FLAGS) 406 $(TARGET_OUT_DATA)/nativetest64/bionic-unit-tests/bionic-unit-tests64 $(BIONIC_TEST_FLAGS)
430endif 407endif
431 408
409endif # x86 x86_64
432endif # linux-x86 410endif # linux-x86
433 411
434include $(call first-makefiles-under,$(LOCAL_PATH)) 412include $(call first-makefiles-under,$(LOCAL_PATH))