]> git.lizzy.rs Git - rust.git/commitdiff
Add one more depth on android test directory for multiple targets
authorEunji Jeong <eun-ji.jeong@samsung.com>
Mon, 2 Feb 2015 08:42:23 +0000 (17:42 +0900)
committerEunji Jeong <eun-ji.jeong@samsung.com>
Tue, 10 Feb 2015 12:53:31 +0000 (21:53 +0900)
mk/install.mk
mk/tests.mk
src/compiletest/compiletest.rs
src/compiletest/runtest.rs
src/etc/adb_run_wrapper.sh

index 24a5c575bfba2949aced7697d402a0df450c4212..6a011d32730c16de75166d67a2815adfe1bb52c3 100644 (file)
@@ -120,7 +120,7 @@ endef
 $(foreach target,$(CFG_TARGET), \
  $(if $(findstring $(CFG_ADB_DEVICE_STATUS),"true"), \
   $(eval $(call INSTALL_RUNTIME_TARGET_N,$(taget),$(CFG_BUILD))) \
-  $(eval $(call INSTALL_RUNTIME_TARGET_CLEANUP_N,arm-linux-$(target))) \
+  $(eval $(call INSTALL_RUNTIME_TARGET_CLEANUP_N,$(target))) \
   ))
 
 install-runtime-target: \
index 3e4bae02427d76e26c9d9f123feb446126099d53..0d5e266c39d7c6ce4f52fd78f36c9f900490ffc5 100644 (file)
@@ -111,7 +111,6 @@ $(foreach target,$(CFG_TARGET), \
 # for arm-linux-androidabi
 define DEF_ADB_DEVICE_STATUS
 CFG_ADB_DEVICE_STATUS=$(1)
-CFG_ANDROID_TARGET_TRIPLE=$(2)
 endef
 
 $(foreach target,$(CFG_TARGET), \
@@ -119,7 +118,7 @@ $(foreach target,$(CFG_TARGET), \
     $(if $(findstring adb,$(CFG_ADB)), \
       $(if $(findstring device,$(shell $(CFG_ADB) devices 2>/dev/null | grep -E '^[:_A-Za-z0-9-]+[[:blank:]]+device')), \
         $(info check: android device attached) \
-        $(eval $(call DEF_ADB_DEVICE_STATUS, true, $(target))), \
+        $(eval $(call DEF_ADB_DEVICE_STATUS, true)), \
         $(info check: android device not attached) \
         $(eval $(call DEF_ADB_DEVICE_STATUS, false)) \
       ), \
@@ -136,12 +135,14 @@ $(info check: android device test dir $(CFG_ADB_TEST_DIR) ready \
  $(shell $(CFG_ADB) remount 1>/dev/null) \
  $(shell $(CFG_ADB) shell rm -r $(CFG_ADB_TEST_DIR) >/dev/null) \
  $(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)) \
- $(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)/tmp) \
  $(shell $(CFG_ADB) push $(S)src/etc/adb_run_wrapper.sh $(CFG_ADB_TEST_DIR) 1>/dev/null) \
- $(foreach crate,$(TARGET_CRATES), \
-    $(shell $(CFG_ADB) push $(TLIB2_T_$(CFG_ANDROID_TARGET_TRIPLE)_H_$(CFG_BUILD))/$(call CFG_LIB_GLOB_$(CFG_ANDROID_TARGET_TRIPLE),$(crate)) \
-                    $(CFG_ADB_TEST_DIR))) \
- )
+ $(foreach target,$(CFG_TARGET), \
+  $(if $(or $(findstring $(target),"arm-linux-androideabi"),$(findstring $(target),"aarch64-linux-android")), \
+   $(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)/$(target)) \
+   $(foreach crate,$(TARGET_CRATES), \
+    $(shell $(CFG_ADB) push $(TLIB2_T_$(target)_H_$(CFG_BUILD))/$(call CFG_LIB_GLOB_$(target),$(crate)) \
+                    $(CFG_ADB_TEST_DIR)/$(target))), \
+ )))
 else
 CFG_ADB_TEST_DIR=
 endif
@@ -401,7 +402,7 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
                $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
        @$$(call E, run: $$< via adb)
        $$(Q)$(CFG_ADB) push $$< $(CFG_ADB_TEST_DIR)
-       $$(Q)$(CFG_ADB) shell '(cd $(CFG_ADB_TEST_DIR); LD_LIBRARY_PATH=. \
+       $$(Q)$(CFG_ADB) shell '(cd $(CFG_ADB_TEST_DIR); LD_LIBRARY_PATH=./$(2) \
                ./$$(notdir $$<) \
                --logfile $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log \
                $$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)) $(TESTARGS))' \
index 1e9f843db34b1cf892bbfd25518bd1b17b3a2ca8..4e1a3fa1c19f34c0a8861aeb1694cd2d1ff2d328 100644 (file)
@@ -156,7 +156,9 @@ fn opt_path(m: &getopts::Matches, nm: &str) -> Path {
         lldb_version: extract_lldb_version(matches.opt_str("lldb-version")),
         android_cross_path: opt_path(matches, "android-cross-path"),
         adb_path: opt_str2(matches.opt_str("adb-path")),
-        adb_test_dir: opt_str2(matches.opt_str("adb-test-dir")),
+        adb_test_dir: format!("{}/{}",
+            opt_str2(matches.opt_str("adb-test-dir")),
+            opt_str2(matches.opt_str("target"))),
         adb_device_status:
             opt_str2(matches.opt_str("target")).contains("android") &&
             "(none)" != opt_str2(matches.opt_str("adb-test-dir")) &&
index 056715e5d1d678a621e2bfbb046fbb7085b7e2fe..43d0fa48900f0002bfed501e4bcd6ce7bb03ad67 100644 (file)
@@ -1509,7 +1509,7 @@ fn _arm_exec_compiled_test(config: &Config,
     for (key, val) in env {
         runargs.push(format!("{}={}", key, val));
     }
-    runargs.push(format!("{}/adb_run_wrapper.sh", config.adb_test_dir));
+    runargs.push(format!("{}/../adb_run_wrapper.sh", config.adb_test_dir));
     runargs.push(format!("{}", config.adb_test_dir));
     runargs.push(format!("{}", prog_short));
 
@@ -1605,7 +1605,7 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) {
                                             file.as_str()
                                                 .unwrap()
                                                 .to_string(),
-                                            config.adb_test_dir.to_string()
+                                            config.adb_test_dir.to_string(),
                                            ],
                                            vec!(("".to_string(),
                                                  "".to_string())),
index 6b5220597e9d7ca4fb55129b77fe10fb894cdde6..bd6c483156f8125df69f0f2753b0dbf5eed15487 100755 (executable)
@@ -24,8 +24,9 @@ then
     then
         shift
 
+        # The length of binary path (i.e. ./$RUN) should be shorter than 128 characters.
         cd $TEST_PATH
-        TEST_EXEC_ENV=22 LD_LIBRARY_PATH=$TEST_PATH PATH=$BIN_PATH:$TEST_PATH $TEST_PATH/$RUN $@ 1>$TEST_PATH/$RUN.stdout 2>$TEST_PATH/$RUN.stderr
+        TEST_EXEC_ENV=22 LD_LIBRARY_PATH=$TEST_PATH PATH=$BIN_PATH:$TEST_PATH ./$RUN $@ 1>$TEST_PATH/$RUN.stdout 2>$TEST_PATH/$RUN.stderr
         L_RET=$?
 
         echo $L_RET > $TEST_PATH/$RUN.exitcode