Auto merge of #63789 - Wind-River:master, r=alexcrichton

Support both static and dynamic linking mode in testing for vxWorks

1. Support both static and dynamic linking mode in testing for vxWorks
2. Ignore unsupported test cases: net:tcp:tests:timeouts and net:ucp:tests:timeouts

r? @alexcrichton
This commit is contained in:
bors 2019-09-06 20:49:20 +00:00
commit da13f06ea0
3 changed files with 24 additions and 4 deletions

View File

@ -1597,7 +1597,8 @@ fn render_inner(addr: &dyn crate::os::windows::io::AsRawSocket) -> impl fmt::Deb
// FIXME: re-enabled openbsd tests once their socket timeout code
// no longer has rounding errors.
#[cfg_attr(any(target_os = "netbsd", target_os = "openbsd"), ignore)]
// VxWorks ignores SO_SNDTIMEO.
#[cfg_attr(any(target_os = "netbsd", target_os = "openbsd", target_os = "vxworks"), ignore)]
#[cfg_attr(target_env = "sgx", ignore)] // FIXME: https://github.com/fortanix/rust-sgx/issues/31
#[test]
fn timeouts() {

View File

@ -1026,7 +1026,8 @@ fn debug() {
// FIXME: re-enabled openbsd/netbsd tests once their socket timeout code
// no longer has rounding errors.
#[cfg_attr(any(target_os = "netbsd", target_os = "openbsd"), ignore)]
// VxWorks ignores SO_SNDTIMEO.
#[cfg_attr(any(target_os = "netbsd", target_os = "openbsd", target_os = "vxworks"), ignore)]
#[test]
fn timeouts() {
let addr = next_test_ip4();

View File

@ -1727,6 +1727,21 @@ fn compute_aux_test_paths(&self, rel_ab: &str) -> TestPaths {
}
}
fn is_vxworks_pure_static(&self) -> bool {
if self.config.target.contains("vxworks") {
match env::var("RUST_VXWORKS_TEST_DYLINK") {
Ok(s) => s != "1",
_ => true
}
} else {
false
}
}
fn is_vxworks_pure_dynamic(&self) -> bool {
self.config.target.contains("vxworks") && !self.is_vxworks_pure_static()
}
fn compose_and_run_compiler(&self, mut rustc: Command, input: Option<String>) -> ProcRes {
let aux_dir = self.aux_output_dir_name();
@ -1770,6 +1785,7 @@ fn compose_and_run_compiler(&self, mut rustc: Command, input: Option<String>) ->
&& !self.config.host.contains("musl"))
|| self.config.target.contains("wasm32")
|| self.config.target.contains("nvptx")
|| self.is_vxworks_pure_static()
{
// We primarily compile all auxiliary libraries as dynamic libraries
// to avoid code size bloat and large binaries as much as possible
@ -2001,7 +2017,8 @@ fn make_compile_args(
}
if !is_rustdoc {
if self.config.target == "wasm32-unknown-unknown" {
if self.config.target == "wasm32-unknown-unknown"
|| self.is_vxworks_pure_static() {
// rustc.arg("-g"); // get any backtrace at all on errors
} else if !self.props.no_prefer_dynamic {
rustc.args(&["-C", "prefer-dynamic"]);
@ -2046,7 +2063,8 @@ fn make_compile_args(
}
// Use dynamic musl for tests because static doesn't allow creating dylibs
if self.config.host.contains("musl") {
if self.config.host.contains("musl")
|| self.is_vxworks_pure_dynamic() {
rustc.arg("-Ctarget-feature=-crt-static");
}