Skip to content

Commit abd7fd9

Browse files
committed
Add one more depth on android test directory for multiple targets
1 parent fbe78e4 commit abd7fd9

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

mk/install.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ endef
120120
$(foreach target,$(CFG_TARGET), \
121121
$(if $(findstring $(CFG_ADB_DEVICE_STATUS),"true"), \
122122
$(eval $(call INSTALL_RUNTIME_TARGET_N,$(taget),$(CFG_BUILD))) \
123-
$(eval $(call INSTALL_RUNTIME_TARGET_CLEANUP_N,arm-linux-$(target))) \
123+
$(eval $(call INSTALL_RUNTIME_TARGET_CLEANUP_N,$(target))) \
124124
))
125125

126126
install-runtime-target: \

mk/tests.mk

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,14 @@ $(foreach target,$(CFG_TARGET), \
111111
# for arm-linux-androidabi
112112
define DEF_ADB_DEVICE_STATUS
113113
CFG_ADB_DEVICE_STATUS=$(1)
114-
CFG_ANDROID_TARGET_TRIPLE=$(2)
115114
endef
116115

117116
$(foreach target,$(CFG_TARGET), \
118117
$(if $(or $(findstring $(target),"arm-linux-androideabi"),$(findstring $(target),"aarch64-linux-android")), \
119118
$(if $(findstring adb,$(CFG_ADB)), \
120119
$(if $(findstring device,$(shell $(CFG_ADB) devices 2>/dev/null | grep -E '^[:_A-Za-z0-9-]+[[:blank:]]+device')), \
121120
$(info check: android device attached) \
122-
$(eval $(call DEF_ADB_DEVICE_STATUS, true, $(target))), \
121+
$(eval $(call DEF_ADB_DEVICE_STATUS, true)), \
123122
$(info check: android device not attached) \
124123
$(eval $(call DEF_ADB_DEVICE_STATUS, false)) \
125124
), \
@@ -136,12 +135,14 @@ $(info check: android device test dir $(CFG_ADB_TEST_DIR) ready \
136135
$(shell $(CFG_ADB) remount 1>/dev/null) \
137136
$(shell $(CFG_ADB) shell rm -r $(CFG_ADB_TEST_DIR) >/dev/null) \
138137
$(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)) \
139-
$(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)/tmp) \
140138
$(shell $(CFG_ADB) push $(S)src/etc/adb_run_wrapper.sh $(CFG_ADB_TEST_DIR) 1>/dev/null) \
141-
$(foreach crate,$(TARGET_CRATES), \
142-
$(shell $(CFG_ADB) push $(TLIB2_T_$(CFG_ANDROID_TARGET_TRIPLE)_H_$(CFG_BUILD))/$(call CFG_LIB_GLOB_$(CFG_ANDROID_TARGET_TRIPLE),$(crate)) \
143-
$(CFG_ADB_TEST_DIR))) \
144-
)
139+
$(foreach target,$(CFG_TARGET), \
140+
$(if $(or $(findstring $(target),"arm-linux-androideabi"),$(findstring $(target),"aarch64-linux-android")), \
141+
$(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)/$(target)) \
142+
$(foreach crate,$(TARGET_CRATES), \
143+
$(shell $(CFG_ADB) push $(TLIB2_T_$(target)_H_$(CFG_BUILD))/$(call CFG_LIB_GLOB_$(target),$(crate)) \
144+
$(CFG_ADB_TEST_DIR)/$(target))), \
145+
)))
145146
else
146147
CFG_ADB_TEST_DIR=
147148
endif
@@ -401,7 +402,7 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
401402
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
402403
@$$(call E, run: $$< via adb)
403404
$$(Q)$(CFG_ADB) push $$< $(CFG_ADB_TEST_DIR)
404-
$$(Q)$(CFG_ADB) shell '(cd $(CFG_ADB_TEST_DIR); LD_LIBRARY_PATH=. \
405+
$$(Q)$(CFG_ADB) shell '(cd $(CFG_ADB_TEST_DIR); LD_LIBRARY_PATH=./$(2) \
405406
./$$(notdir $$<) \
406407
--logfile $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log \
407408
$$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)) $(TESTARGS))' \

src/compiletest/compiletest.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ pub fn parse_config(args: Vec<String> ) -> Config {
156156
lldb_version: extract_lldb_version(matches.opt_str("lldb-version")),
157157
android_cross_path: opt_path(matches, "android-cross-path"),
158158
adb_path: opt_str2(matches.opt_str("adb-path")),
159-
adb_test_dir: opt_str2(matches.opt_str("adb-test-dir")),
159+
adb_test_dir: format!("{}/{}",
160+
opt_str2(matches.opt_str("adb-test-dir")),
161+
opt_str2(matches.opt_str("target"))),
160162
adb_device_status:
161163
opt_str2(matches.opt_str("target")).contains("android") &&
162164
"(none)" != opt_str2(matches.opt_str("adb-test-dir")) &&

src/compiletest/runtest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,7 @@ fn _arm_exec_compiled_test(config: &Config,
15091509
for (key, val) in env {
15101510
runargs.push(format!("{}={}", key, val));
15111511
}
1512-
runargs.push(format!("{}/adb_run_wrapper.sh", config.adb_test_dir));
1512+
runargs.push(format!("{}/../adb_run_wrapper.sh", config.adb_test_dir));
15131513
runargs.push(format!("{}", config.adb_test_dir));
15141514
runargs.push(format!("{}", prog_short));
15151515

@@ -1605,7 +1605,7 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) {
16051605
file.as_str()
16061606
.unwrap()
16071607
.to_string(),
1608-
config.adb_test_dir.to_string()
1608+
config.adb_test_dir.to_string(),
16091609
],
16101610
vec!(("".to_string(),
16111611
"".to_string())),

src/etc/adb_run_wrapper.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ then
2424
then
2525
shift
2626

27+
# The length of binary path (i.e. ./$RUN) should be shorter than 128 characters.
2728
cd $TEST_PATH
28-
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
29+
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
2930
L_RET=$?
3031

3132
echo $L_RET > $TEST_PATH/$RUN.exitcode

0 commit comments

Comments
 (0)