Skip to content

Commit da13f06

Browse files
committed
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
2 parents 6e19f3f + 414d104 commit da13f06

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

src/libstd/net/tcp.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1597,7 +1597,8 @@ mod tests {
15971597

15981598
// FIXME: re-enabled openbsd tests once their socket timeout code
15991599
// no longer has rounding errors.
1600-
#[cfg_attr(any(target_os = "netbsd", target_os = "openbsd"), ignore)]
1600+
// VxWorks ignores SO_SNDTIMEO.
1601+
#[cfg_attr(any(target_os = "netbsd", target_os = "openbsd", target_os = "vxworks"), ignore)]
16011602
#[cfg_attr(target_env = "sgx", ignore)] // FIXME: https://github.com/fortanix/rust-sgx/issues/31
16021603
#[test]
16031604
fn timeouts() {

src/libstd/net/udp.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,8 @@ mod tests {
10261026

10271027
// FIXME: re-enabled openbsd/netbsd tests once their socket timeout code
10281028
// no longer has rounding errors.
1029-
#[cfg_attr(any(target_os = "netbsd", target_os = "openbsd"), ignore)]
1029+
// VxWorks ignores SO_SNDTIMEO.
1030+
#[cfg_attr(any(target_os = "netbsd", target_os = "openbsd", target_os = "vxworks"), ignore)]
10301031
#[test]
10311032
fn timeouts() {
10321033
let addr = next_test_ip4();

src/tools/compiletest/src/runtest.rs

+20-2
Original file line numberDiff line numberDiff line change
@@ -1727,6 +1727,21 @@ impl<'test> TestCx<'test> {
17271727
}
17281728
}
17291729

1730+
fn is_vxworks_pure_static(&self) -> bool {
1731+
if self.config.target.contains("vxworks") {
1732+
match env::var("RUST_VXWORKS_TEST_DYLINK") {
1733+
Ok(s) => s != "1",
1734+
_ => true
1735+
}
1736+
} else {
1737+
false
1738+
}
1739+
}
1740+
1741+
fn is_vxworks_pure_dynamic(&self) -> bool {
1742+
self.config.target.contains("vxworks") && !self.is_vxworks_pure_static()
1743+
}
1744+
17301745
fn compose_and_run_compiler(&self, mut rustc: Command, input: Option<String>) -> ProcRes {
17311746
let aux_dir = self.aux_output_dir_name();
17321747

@@ -1770,6 +1785,7 @@ impl<'test> TestCx<'test> {
17701785
&& !self.config.host.contains("musl"))
17711786
|| self.config.target.contains("wasm32")
17721787
|| self.config.target.contains("nvptx")
1788+
|| self.is_vxworks_pure_static()
17731789
{
17741790
// We primarily compile all auxiliary libraries as dynamic libraries
17751791
// to avoid code size bloat and large binaries as much as possible
@@ -2001,7 +2017,8 @@ impl<'test> TestCx<'test> {
20012017
}
20022018

20032019
if !is_rustdoc {
2004-
if self.config.target == "wasm32-unknown-unknown" {
2020+
if self.config.target == "wasm32-unknown-unknown"
2021+
|| self.is_vxworks_pure_static() {
20052022
// rustc.arg("-g"); // get any backtrace at all on errors
20062023
} else if !self.props.no_prefer_dynamic {
20072024
rustc.args(&["-C", "prefer-dynamic"]);
@@ -2046,7 +2063,8 @@ impl<'test> TestCx<'test> {
20462063
}
20472064

20482065
// Use dynamic musl for tests because static doesn't allow creating dylibs
2049-
if self.config.host.contains("musl") {
2066+
if self.config.host.contains("musl")
2067+
|| self.is_vxworks_pure_dynamic() {
20502068
rustc.arg("-Ctarget-feature=-crt-static");
20512069
}
20522070

0 commit comments

Comments
 (0)