mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-23 12:23:22 +00:00
Make aarch64-linux-android check with real target
This commit is contained in:
parent
134e00be77
commit
5cbdf1db9b
@ -65,7 +65,7 @@ CFG_ADB_DEVICE_STATUS=$(1)
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
$(foreach target,$(CFG_TARGET), \
|
$(foreach target,$(CFG_TARGET), \
|
||||||
$(if $(findstring $(target),"arm-linux-androideabi"), \
|
$(if $(or $(findstring $(target),"arm-linux-androideabi"),$(findstring $(target),"aarch64-linux-android")), \
|
||||||
$(if $(findstring adb,$(CFG_ADB)), \
|
$(if $(findstring adb,$(CFG_ADB)), \
|
||||||
$(if $(findstring device,$(shell $(CFG_ADB) devices 2>/dev/null | grep -E '^[_A-Za-z0-9-]+[[:blank:]]+device')), \
|
$(if $(findstring device,$(shell $(CFG_ADB) devices 2>/dev/null | grep -E '^[_A-Za-z0-9-]+[[:blank:]]+device')), \
|
||||||
$(info install: install-runtime-target for $(target) enabled \
|
$(info install: install-runtime-target for $(target) enabled \
|
||||||
@ -117,8 +117,11 @@ install-runtime-target-$(1)-cleanup:
|
|||||||
$$(call ADB_SHELL,rm,$$(CFG_RUNTIME_PUSH_DIR)/$$(call CFG_LIB_GLOB_$(1),$$(crate)));)
|
$$(call ADB_SHELL,rm,$$(CFG_RUNTIME_PUSH_DIR)/$$(call CFG_LIB_GLOB_$(1),$$(crate)));)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call INSTALL_RUNTIME_TARGET_N,arm-linux-androideabi,$(CFG_BUILD)))
|
$(foreach target,$(CFG_TARGET), \
|
||||||
$(eval $(call INSTALL_RUNTIME_TARGET_CLEANUP_N,arm-linux-androideabi))
|
$(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))) \
|
||||||
|
))
|
||||||
|
|
||||||
install-runtime-target: \
|
install-runtime-target: \
|
||||||
install-runtime-target-arm-linux-androideabi-cleanup \
|
install-runtime-target-arm-linux-androideabi-cleanup \
|
||||||
|
13
mk/tests.mk
13
mk/tests.mk
@ -111,14 +111,15 @@ $(foreach target,$(CFG_TARGET), \
|
|||||||
# for arm-linux-androidabi
|
# for arm-linux-androidabi
|
||||||
define DEF_ADB_DEVICE_STATUS
|
define DEF_ADB_DEVICE_STATUS
|
||||||
CFG_ADB_DEVICE_STATUS=$(1)
|
CFG_ADB_DEVICE_STATUS=$(1)
|
||||||
|
CFG_ANDROID_TARGET_TRIPLE=$(2)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(foreach target,$(CFG_TARGET), \
|
$(foreach target,$(CFG_TARGET), \
|
||||||
$(if $(findstring $(target),"arm-linux-androideabi"), \
|
$(if $(or $(findstring $(target),"arm-linux-androideabi"),$(findstring $(target),"aarch64-linux-android")), \
|
||||||
$(if $(findstring adb,$(CFG_ADB)), \
|
$(if $(findstring adb,$(CFG_ADB)), \
|
||||||
$(if $(findstring device,$(shell $(CFG_ADB) devices 2>/dev/null | grep -E '^[:_A-Za-z0-9-]+[[:blank:]]+device')), \
|
$(if $(findstring device,$(shell $(CFG_ADB) devices 2>/dev/null | grep -E '^[:_A-Za-z0-9-]+[[:blank:]]+device')), \
|
||||||
$(info check: android device attached) \
|
$(info check: android device attached) \
|
||||||
$(eval $(call DEF_ADB_DEVICE_STATUS, true)), \
|
$(eval $(call DEF_ADB_DEVICE_STATUS, true, $(target))), \
|
||||||
$(info check: android device not attached) \
|
$(info check: android device not attached) \
|
||||||
$(eval $(call DEF_ADB_DEVICE_STATUS, false)) \
|
$(eval $(call DEF_ADB_DEVICE_STATUS, false)) \
|
||||||
), \
|
), \
|
||||||
@ -138,7 +139,7 @@ $(info check: android device test dir $(CFG_ADB_TEST_DIR) ready \
|
|||||||
$(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)/tmp) \
|
$(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) \
|
$(shell $(CFG_ADB) push $(S)src/etc/adb_run_wrapper.sh $(CFG_ADB_TEST_DIR) 1>/dev/null) \
|
||||||
$(foreach crate,$(TARGET_CRATES), \
|
$(foreach crate,$(TARGET_CRATES), \
|
||||||
$(shell $(CFG_ADB) push $(TLIB2_T_arm-linux-androideabi_H_$(CFG_BUILD))/$(call CFG_LIB_GLOB_arm-linux-androideabi,$(crate)) \
|
$(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))) \
|
$(CFG_ADB_TEST_DIR))) \
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
@ -393,7 +394,7 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
|
|||||||
&& touch $$@
|
&& touch $$@
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define DEF_TEST_CRATE_RULES_arm-linux-androideabi
|
define DEF_TEST_CRATE_RULES_android
|
||||||
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
|
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
|
||||||
|
|
||||||
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
|
||||||
@ -434,9 +435,9 @@ $(foreach host,$(CFG_HOST), \
|
|||||||
$(foreach crate, $(TEST_CRATES), \
|
$(foreach crate, $(TEST_CRATES), \
|
||||||
$(if $(findstring $(target),$(CFG_BUILD)), \
|
$(if $(findstring $(target),$(CFG_BUILD)), \
|
||||||
$(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))), \
|
$(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))), \
|
||||||
$(if $(findstring $(target),"arm-linux-androideabi"), \
|
$(if $(or $(findstring $(target),"arm-linux-androideabi"), $(findstring $(target),"aarch64-linux-android")), \
|
||||||
$(if $(findstring $(CFG_ADB_DEVICE_STATUS),"true"), \
|
$(if $(findstring $(CFG_ADB_DEVICE_STATUS),"true"), \
|
||||||
$(eval $(call DEF_TEST_CRATE_RULES_arm-linux-androideabi,$(stage),$(target),$(host),$(crate))), \
|
$(eval $(call DEF_TEST_CRATE_RULES_android,$(stage),$(target),$(host),$(crate))), \
|
||||||
$(eval $(call DEF_TEST_CRATE_RULES_null,$(stage),$(target),$(host),$(crate))) \
|
$(eval $(call DEF_TEST_CRATE_RULES_null,$(stage),$(target),$(host),$(crate))) \
|
||||||
), \
|
), \
|
||||||
$(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))) \
|
$(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))) \
|
||||||
|
@ -158,10 +158,8 @@ pub fn parse_config(args: Vec<String> ) -> Config {
|
|||||||
adb_path: opt_str2(matches.opt_str("adb-path")),
|
adb_path: opt_str2(matches.opt_str("adb-path")),
|
||||||
adb_test_dir: opt_str2(matches.opt_str("adb-test-dir")),
|
adb_test_dir: opt_str2(matches.opt_str("adb-test-dir")),
|
||||||
adb_device_status:
|
adb_device_status:
|
||||||
"arm-linux-androideabi" ==
|
opt_str2(matches.opt_str("target")).contains("android") &&
|
||||||
opt_str2(matches.opt_str("target")) &&
|
"(none)" != opt_str2(matches.opt_str("adb-test-dir")) &&
|
||||||
"(none)" !=
|
|
||||||
opt_str2(matches.opt_str("adb-test-dir")) &&
|
|
||||||
!opt_str2(matches.opt_str("adb-test-dir")).is_empty(),
|
!opt_str2(matches.opt_str("adb-test-dir")).is_empty(),
|
||||||
lldb_python_dir: matches.opt_str("lldb-python-dir"),
|
lldb_python_dir: matches.opt_str("lldb-python-dir"),
|
||||||
verbose: matches.opt_present("verbose"),
|
verbose: matches.opt_present("verbose"),
|
||||||
@ -216,17 +214,17 @@ pub fn opt_str2(maybestr: Option<String>) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn run_tests(config: &Config) {
|
pub fn run_tests(config: &Config) {
|
||||||
if config.target == "arm-linux-androideabi" {
|
if config.target.contains("android") {
|
||||||
match config.mode {
|
match config.mode {
|
||||||
DebugInfoGdb => {
|
DebugInfoGdb => {
|
||||||
println!("arm-linux-androideabi debug-info \
|
println!("{} debug-info test uses tcp 5039 port.\
|
||||||
test uses tcp 5039 port. please reserve it");
|
please reserve it", config.target);
|
||||||
}
|
}
|
||||||
_ =>{}
|
_ =>{}
|
||||||
}
|
}
|
||||||
|
|
||||||
//arm-linux-androideabi debug-info test uses remote debugger
|
// android debug-info test uses remote debugger
|
||||||
//so, we test 1 task at once.
|
// so, we test 1 task at once.
|
||||||
// also trying to isolate problems with adb_run_wrapper.sh ilooping
|
// also trying to isolate problems with adb_run_wrapper.sh ilooping
|
||||||
env::set_var("RUST_TEST_TASKS","1");
|
env::set_var("RUST_TEST_TASKS","1");
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ use test::MetricMap;
|
|||||||
pub fn run(config: Config, testfile: String) {
|
pub fn run(config: Config, testfile: String) {
|
||||||
match &*config.target {
|
match &*config.target {
|
||||||
|
|
||||||
"arm-linux-androideabi" => {
|
"arm-linux-androideabi" | "aarch64-linux-android" => {
|
||||||
if !config.adb_device_status {
|
if !config.adb_device_status {
|
||||||
panic!("android device not available");
|
panic!("android device not available");
|
||||||
}
|
}
|
||||||
@ -382,7 +382,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
|
|||||||
|
|
||||||
let debugger_run_result;
|
let debugger_run_result;
|
||||||
match &*config.target {
|
match &*config.target {
|
||||||
"arm-linux-androideabi" => {
|
"arm-linux-androideabi" | "aarch64-linux-android" => {
|
||||||
|
|
||||||
cmds = cmds.replace("run", "continue").to_string();
|
cmds = cmds.replace("run", "continue").to_string();
|
||||||
|
|
||||||
@ -470,7 +470,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
|
|||||||
format!("-command={}", debugger_script.as_str().unwrap()));
|
format!("-command={}", debugger_script.as_str().unwrap()));
|
||||||
|
|
||||||
let mut gdb_path = tool_path;
|
let mut gdb_path = tool_path;
|
||||||
gdb_path.push_str("/bin/arm-linux-androideabi-gdb");
|
gdb_path.push_str(&format!("/bin/{}-gdb", config.target));
|
||||||
let procsrv::Result {
|
let procsrv::Result {
|
||||||
out,
|
out,
|
||||||
err,
|
err,
|
||||||
@ -484,7 +484,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
|
|||||||
.expect(&format!("failed to exec `{:?}`", gdb_path));
|
.expect(&format!("failed to exec `{:?}`", gdb_path));
|
||||||
let cmdline = {
|
let cmdline = {
|
||||||
let cmdline = make_cmdline("",
|
let cmdline = make_cmdline("",
|
||||||
"arm-linux-androideabi-gdb",
|
&format!("{}-gdb", config.target),
|
||||||
&debugger_opts);
|
&debugger_opts);
|
||||||
logv(config, format!("executing {}", cmdline));
|
logv(config, format!("executing {}", cmdline));
|
||||||
cmdline
|
cmdline
|
||||||
@ -1135,7 +1135,7 @@ fn exec_compiled_test(config: &Config, props: &TestProps,
|
|||||||
|
|
||||||
match &*config.target {
|
match &*config.target {
|
||||||
|
|
||||||
"arm-linux-androideabi" => {
|
"arm-linux-androideabi" | "aarch64-linux-android" => {
|
||||||
_arm_exec_compiled_test(config, props, testfile, env)
|
_arm_exec_compiled_test(config, props, testfile, env)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1200,7 +1200,7 @@ fn compose_and_run_compiler(
|
|||||||
}
|
}
|
||||||
|
|
||||||
match &*config.target {
|
match &*config.target {
|
||||||
"arm-linux-androideabi" => {
|
"arm-linux-androideabi" | "aarch64-linux-android" => {
|
||||||
_arm_push_aux_shared_library(config, testfile);
|
_arm_push_aux_shared_library(config, testfile);
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
|
@ -345,11 +345,13 @@ impl Target {
|
|||||||
mips_unknown_linux_gnu,
|
mips_unknown_linux_gnu,
|
||||||
mipsel_unknown_linux_gnu,
|
mipsel_unknown_linux_gnu,
|
||||||
powerpc_unknown_linux_gnu,
|
powerpc_unknown_linux_gnu,
|
||||||
arm_linux_androideabi,
|
|
||||||
arm_unknown_linux_gnueabi,
|
arm_unknown_linux_gnueabi,
|
||||||
arm_unknown_linux_gnueabihf,
|
arm_unknown_linux_gnueabihf,
|
||||||
aarch64_unknown_linux_gnu,
|
aarch64_unknown_linux_gnu,
|
||||||
|
|
||||||
|
arm_linux_androideabi,
|
||||||
|
aarch64_linux_android,
|
||||||
|
|
||||||
x86_64_unknown_freebsd,
|
x86_64_unknown_freebsd,
|
||||||
|
|
||||||
i686_unknown_dragonfly,
|
i686_unknown_dragonfly,
|
||||||
@ -363,7 +365,6 @@ impl Target {
|
|||||||
i386_apple_ios,
|
i386_apple_ios,
|
||||||
x86_64_apple_ios,
|
x86_64_apple_ios,
|
||||||
aarch64_apple_ios,
|
aarch64_apple_ios,
|
||||||
aarch64_linux_android,
|
|
||||||
armv7_apple_ios,
|
armv7_apple_ios,
|
||||||
armv7s_apple_ios,
|
armv7s_apple_ios,
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user