Skip to content

Commit 17b368f

Browse files
committed
mk: configurable android test directory
1 parent 6f6dd86 commit 17b368f

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

mk/install.mk

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ endef
164164
$(foreach target,$(CFG_TARGET_TRIPLES), \
165165
$(if $(findstring $(target),"arm-linux-androideabi"), \
166166
$(if $(findstring adb,$(shell which adb)), \
167-
$(if $(findstring device,$(shell adb devices 2>/dev/null | grep -E '^[A-Za-z0-9]+[[:blank:]]+device')), \
167+
$(if $(findstring device,$(shell adb devices 2>/dev/null | grep -E '^[A-Za-z0-9-]+[[:blank:]]+device')), \
168168
$(info install: install-runtime-target for arm-linux-androideabi enabled \
169169
$(info install: android device attached) \
170170
$(eval $(call DEF_ADB_STATUS, true))), \
@@ -181,6 +181,8 @@ $(foreach target,$(CFG_TARGET_TRIPLES), \
181181

182182
ifeq ($(CFG_ADB_DEVICE),true)
183183

184+
CFG_RUNTIME_PUSH_DIR=/system/lib
185+
184186
ifdef VERBOSE
185187
ADB = adb $(1)
186188
ADB_PUSH = adb push $(1) $(2)
@@ -193,17 +195,18 @@ endif
193195

194196
define INSTALL_RUNTIME_TARGET_N
195197
install-runtime-target-$(1)-host-$(2): $$(TSREQ$$(ISTAGE)_T_$(1)_H_$(2)) $$(SREQ$$(ISTAGE)_T_$(1)_H_$(2))
196-
$(Q)$(call ADB_PUSH,$$(TL$(1)$(2))/$$(CFG_RUNTIME_$(1)),/system/lib)
197-
$(Q)$(call ADB_PUSH,$$(TL$(1)$(2))/$$(CORELIB_GLOB_$(1)),/system/lib)
198-
$(Q)$(call ADB_PUSH,$$(TL$(1)$(2))/$$(STDLIB_GLOB_$(1)),/system/lib)
198+
$(Q)$(call ADB_SHELL,mkdir,$(CFG_RUNTIME_PUSH_DIR))
199+
$(Q)$(call ADB_PUSH,$$(TL$(1)$(2))/$$(CFG_RUNTIME_$(1)),$(CFG_RUNTIME_PUSH_DIR))
200+
$(Q)$(call ADB_PUSH,$$(TL$(1)$(2))/$$(CORELIB_GLOB_$(1)),$(CFG_RUNTIME_PUSH_DIR))
201+
$(Q)$(call ADB_PUSH,$$(TL$(1)$(2))/$$(STDLIB_GLOB_$(1)),$(CFG_RUNTIME_PUSH_DIR))
199202
endef
200203

201204
define INSTALL_RUNTIME_TARGET_CLEANUP_N
202205
install-runtime-target-$(1)-cleanup:
203206
$(Q)$(call ADB,remount)
204-
$(Q)$(call ADB_SHELL,rm,/system/lib/$(CFG_RUNTIME_$(1)))
205-
$(Q)$(call ADB_SHELL,rm,/system/lib/$(CORELIB_GLOB_$(1)))
206-
$(Q)$(call ADB_SHELL,rm,/system/lib/$(STDLIB_GLOB_$(1)))
207+
$(Q)$(call ADB_SHELL,rm,$(CFG_RUNTIME_PUSH_DIR)/$(CFG_RUNTIME_$(1)))
208+
$(Q)$(call ADB_SHELL,rm,$(CFG_RUNTIME_PUSH_DIR)/$(CORELIB_GLOB_$(1)))
209+
$(Q)$(call ADB_SHELL,rm,$(CFG_RUNTIME_PUSH_DIR)/$(STDLIB_GLOB_$(1)))
207210
endef
208211

209212
$(eval $(call INSTALL_RUNTIME_TARGET_N,arm-linux-androideabi,$(CFG_BUILD_TRIPLE)))

mk/tests.mk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ $(foreach target,$(CFG_TARGET_TRIPLES), \
104104
$(eval $(call DEF_RUNNABLE_STATUS,$(target),true))), \
105105
$(if $(findstring $(target),"arm-linux-androideabi"), \
106106
$(if $(findstring adb,$(shell which adb)), \
107-
$(if $(findstring device,$(shell adb devices 2>/dev/null | grep -E '^[A-Za-z0-9]+[[:blank:]]+device')), \
107+
$(if $(findstring device,$(shell adb devices 2>/dev/null | grep -E '^[A-Za-z0-9-]+[[:blank:]]+device')), \
108108
$(info check: $(target) test set is runnable \
109109
$(info check: adb device attached) \
110110
$(eval $(call DEF_RUNNABLE_STATUS,$(target),true))), \
@@ -129,9 +129,8 @@ CFG_ADB_PATH := $(shell which adb)
129129
CFG_ADB_TEST_DIR=/system/tmp
130130

131131
$(info check: device $(CFG_ADB_TEST_DIR) \
132+
$(shell $(CFG_ADB_PATH) remount 1>/dev/null) \
132133
$(shell $(CFG_ADB_PATH) shell mkdir $(CFG_ADB_TEST_DIR) 1>/dev/null) \
133-
$(shell $(CFG_ADB_PATH) shell rm $(CFG_ADB_TEST_DIR)/*-arm-linux-androideabi 1>/dev/null) \
134-
$(shell $(CFG_ADB_PATH) shell rm $(CFG_ADB_TEST_DIR)/*.so 1>/dev/null) \
135134
)
136135
endif
137136

0 commit comments

Comments
 (0)