Skip to content

Commit

Permalink
Fix x86_64 Linux/musl tests
Browse files Browse the repository at this point in the history
Seems that pretty mush all aio tests fail on x64 musl builds.
  • Loading branch information
Susurrus committed Apr 18, 2017
1 parent 63e6b4a commit 3a77c3b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ matrix:
- env: TARGET=i686-unknown-linux-musl
# - env: TARGET=x86_64-unknown-linux-gnu # this is the default job
- env: TARGET=x86_64-unknown-linux-musl
- env: TARGET=x86_64-unknown-linux-musl DISABLE_TESTS=1

# OSX
- env: TARGET=i686-apple-darwin
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ Tier 1:
* mips-unknown-linux-gnu
* mipsel-unknown-linux-gnu
* i686-unknown-linux-musl
* x86_64-unknown-linux-musl

Tier 2:
* i686-unknown-freebsd
* x86_64-unknown-freebsd
* x86_64-unknown-netbsd
* x86_64-unknown-linux-musl

## Usage

Expand Down
13 changes: 12 additions & 1 deletion test/sys/test_aio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ fn poll_aio(mut aiocb: &mut AioCb) -> Result<()> {
// bindings. So it's sufficient to check that AioCb.cancel returned any
// AioCancelStat value.
#[test]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_cancel() {
let wbuf: &'static [u8] = b"CDEF";

Expand All @@ -50,6 +51,7 @@ fn test_cancel() {

// Tests using aio_cancel_all for all outstanding IOs.
#[test]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_aio_cancel_all() {
let wbuf: &'static [u8] = b"CDEF";

Expand All @@ -73,6 +75,7 @@ fn test_aio_cancel_all() {
}

#[test]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_fsync() {
const INITIAL: &'static [u8] = b"abcdef123456";
let mut f = tempfile().unwrap();
Expand All @@ -88,6 +91,7 @@ fn test_fsync() {


#[test]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_aio_suspend() {
const INITIAL: &'static [u8] = b"abcdef123456";
const WBUF: &'static [u8] = b"CDEF";
Expand Down Expand Up @@ -129,6 +133,7 @@ fn test_aio_suspend() {
// Test a simple aio operation with no completion notification. We must poll
// for completion
#[test]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_read() {
const INITIAL: &'static [u8] = b"abcdef123456";
let rbuf = Rc::new(vec![0; 4].into_boxed_slice());
Expand All @@ -154,6 +159,7 @@ fn test_read() {

// Tests from_mut_slice
#[test]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_read_into_mut_slice() {
const INITIAL: &'static [u8] = b"abcdef123456";
let mut rbuf = vec![0; 4];
Expand Down Expand Up @@ -198,6 +204,7 @@ fn test_read_immutable_buffer() {
// Test a simple aio operation with no completion notification. We must poll
// for completion. Unlike test_aio_read, this test uses AioCb::from_slice
#[test]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_write() {
const INITIAL: &'static [u8] = b"abcdef123456";
let wbuf = "CDEF".to_string().into_bytes();
Expand Down Expand Up @@ -236,6 +243,7 @@ extern fn sigfunc(_: c_int) {

// Test an aio operation with completion delivered by a signal
#[test]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_write_sigev_signal() {
let _ = SIGUSR2_MTX.lock().expect("Mutex got poisoned by another test");
let sa = SigAction::new(SigHandler::Handler(sigfunc),
Expand Down Expand Up @@ -276,6 +284,7 @@ fn test_write_sigev_signal() {
// lio_listio returns.
#[test]
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_lio_listio_wait() {
const INITIAL: &'static [u8] = b"abcdef123456";
const WBUF: &'static [u8] = b"CDEF";
Expand Down Expand Up @@ -318,6 +327,7 @@ fn test_lio_listio_wait() {
// mechanism to check for the individual AioCb's completion.
#[test]
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_lio_listio_nowait() {
const INITIAL: &'static [u8] = b"abcdef123456";
const WBUF: &'static [u8] = b"CDEF";
Expand Down Expand Up @@ -363,7 +373,7 @@ fn test_lio_listio_nowait() {
// FIXME: This test is ignored on mips because of failures in qemu in CI
#[test]
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
#[cfg_attr(all(target_arch = "mips", travis), ignore)]
#[cfg_attr(any(all(target_arch = "mips", travis), target_env = "musl"), ignore)]
fn test_lio_listio_signal() {
let _ = SIGUSR2_MTX.lock().expect("Mutex got poisoned by another test");
const INITIAL: &'static [u8] = b"abcdef123456";
Expand Down Expand Up @@ -436,6 +446,7 @@ fn test_lio_listio_read_immutable() {
// Test dropping an AioCb that hasn't yet finished. Behind the scenes, the
// library should wait for the AioCb's completion.
#[test]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_drop() {
const INITIAL: &'static [u8] = b"abcdef123456";
const WBUF: &'static [u8] = b"CDEF"; //"CDEF".to_string().into_bytes();
Expand Down

0 comments on commit 3a77c3b

Please sign in to comment.