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.
This commit is contained in:
bors 2013-08-22 08:31:28 -07:00
commit 5003f607ec
1 changed files with 9 additions and 6 deletions

View File

@ -144,8 +144,9 @@ CFG_ADB_TEST_DIR=/data/tmp
$(info check: android device test dir $(CFG_ADB_TEST_DIR) ready \
$(shell adb remount 1>/dev/null) \
$(shell adb shell mkdir $(CFG_ADB_TEST_DIR) 1>/dev/null) \
$(shell adb shell rm -rf $(CFG_ADB_TEST_DIR)/* 1>/dev/null) \
$(shell adb shell rm -r $(CFG_ADB_TEST_DIR) >/dev/null) \
$(shell adb shell mkdir $(CFG_ADB_TEST_DIR)) \
$(shell adb shell mkdir $(CFG_ADB_TEST_DIR)/tmp) \
$(shell adb push $(S)src/etc/adb_run_wrapper.sh $(CFG_ADB_TEST_DIR) 1>/dev/null) \
$(shell adb push $(CFG_ANDROID_CROSS_PATH)/arm-linux-androideabi/lib/armv7-a/libgnustl_shared.so \
$(CFG_ADB_TEST_DIR) 1>/dev/null) \
@ -409,14 +410,16 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
@$$(call E, run: $$< via adb)
@$(CFG_ADB) push $$< $(CFG_ADB_TEST_DIR)
@$(CFG_ADB) shell LD_LIBRARY_PATH=$(CFG_ADB_TEST_DIR) \
$(CFG_ADB_TEST_DIR)/`echo $$< | sed 's/.*\///'` \
--logfile $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log > \
tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
@$(CFG_ADB) shell '(cd $(CFG_ADB_TEST_DIR); LD_LIBRARY_PATH=. \
./$$(notdir $$<) \
--logfile $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log \
$$(call CRATE_TEST_BENCH_ARGS,$(1),$(2),$(3),$(4)))' \
> tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
@cat tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
@touch tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
@$(CFG_ADB) pull $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log tmp/
@$(CFG_ADB) shell rm $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
@$(CFG_ADB) pull $(CFG_ADB_TEST_DIR)/$$(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4)) tmp/
@if grep -q "result: ok" tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
then \
rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \