Skip to content

Commit 5003f60

Browse files
committed
auto merge of #8642 : sanxiyn/rust/arm-test, r=catamorphism
`stdtest` and `extratest` expects to be able to write to `tmp` directory under the current working directory, so the first commit creates `tmp` directory and changes the directory before running tests. The second commit adds `--bench` argument to test runs and copies metrics from the remote device.
2 parents 4e3dbf9 + 0276fe4 commit 5003f60

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

mk/tests.mk

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,9 @@ CFG_ADB_TEST_DIR=/data/tmp
144144

145145
$(info check: android device test dir $(CFG_ADB_TEST_DIR) ready \
146146
$(shell adb remount 1>/dev/null) \
147-
$(shell adb shell mkdir $(CFG_ADB_TEST_DIR) 1>/dev/null) \
148-
$(shell adb shell rm -rf $(CFG_ADB_TEST_DIR)/* 1>/dev/null) \
147+
$(shell adb shell rm -r $(CFG_ADB_TEST_DIR) >/dev/null) \
148+
$(shell adb shell mkdir $(CFG_ADB_TEST_DIR)) \
149+
$(shell adb shell mkdir $(CFG_ADB_TEST_DIR)/tmp) \
149150
$(shell adb push $(S)src/etc/adb_run_wrapper.sh $(CFG_ADB_TEST_DIR) 1>/dev/null) \
150151
$(shell adb push $(CFG_ANDROID_CROSS_PATH)/arm-linux-androideabi/lib/armv7-a/libgnustl_shared.so \
151152
$(CFG_ADB_TEST_DIR) 1>/dev/null) \
@@ -409,14 +410,16 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
409410
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
410411
@$$(call E, run: $$< via adb)
411412
@$(CFG_ADB) push $$< $(CFG_ADB_TEST_DIR)
412-
@$(CFG_ADB) shell LD_LIBRARY_PATH=$(CFG_ADB_TEST_DIR) \
413-
$(CFG_ADB_TEST_DIR)/`echo $$< | sed 's/.*\///'` \
414-
--logfile $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log > \
415-
tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
413+
@$(CFG_ADB) shell '(cd $(CFG_ADB_TEST_DIR); LD_LIBRARY_PATH=. \
414+
./$$(notdir $$<) \
415+
--logfile $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log \
416+
$$(call CRATE_TEST_BENCH_ARGS,$(1),$(2),$(3),$(4)))' \
417+
> tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
416418
@cat tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
417419
@touch tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
418420
@$(CFG_ADB) pull $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log tmp/
419421
@$(CFG_ADB) shell rm $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
422+
@$(CFG_ADB) pull $(CFG_ADB_TEST_DIR)/$$(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4)) tmp/
420423
@if grep -q "result: ok" tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
421424
then \
422425
rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \

0 commit comments

Comments
 (0)