Skip to content

Commit

Permalink
test: Fix some tests to run with musl
Browse files Browse the repository at this point in the history
There were a few test cases to fix:

* Dynamic libraries are not supported with MUSL right now, so all of those
  related test which force or require dylibs are ignored.
* Looks like the default stack for MUSL is smaller than glibc, so a few stack
  allocations in benchmarks were boxed up (shouldn't have a perf impact).
* Some small linkage tweaks here and there
* Out-of-stack detection does not currently work with MUSL
  • Loading branch information
alexcrichton committed Apr 27, 2015
1 parent 60f8f6b commit faa1a81
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/test/bench/noise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ impl Noise2DContext {

fn main() {
let symbols = [' ', '░', '▒', '▓', '█', '█'];
let mut pixels = [0f32; 256*256];
let n2d = Noise2DContext::new();
let mut pixels = Box::new([0f32; 256*256]);
let n2d = Box::new(Noise2DContext::new());

for _ in 0..100 {
for y in 0..256 {
Expand Down
8 changes: 4 additions & 4 deletions src/test/bench/shootout-reverse-complement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ use std::ptr::copy;
use std::thread;

struct Tables {
table8: [u8; 1 << 8],
table16: [u16; 1 << 16]
table8: Box<[u8; 1 << 8]>,
table16: Box<[u16; 1 << 16]>,
}

impl Tables {
fn new() -> Tables {
let mut table8 = [0;1 << 8];
let mut table8 = Box::new([0;1 << 8]);
for (i, v) in table8.iter_mut().enumerate() {
*v = Tables::computed_cpl8(i as u8);
}
let mut table16 = [0;1 << 16];
let mut table16 = Box::new([0;1 << 16]);
for (i, v) in table16.iter_mut().enumerate() {
*v = (table8[i & 255] as u16) << 8 |
table8[i >> 8] as u16;
Expand Down
1 change: 1 addition & 0 deletions src/test/run-pass-fulldeps/issue-13560.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// aux-build:issue-13560-2.rs
// aux-build:issue-13560-3.rs
// ignore-stage1
// ignore-musl

// Regression test for issue #13560, the test itself is all in the dependent
// libraries. The fail which previously failed to compile is the one numbered 3.
Expand Down
1 change: 1 addition & 0 deletions src/test/run-pass/issue-12133-3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// aux-build:issue-12133-rlib.rs
// aux-build:issue-12133-dylib.rs
// aux-build:issue-12133-dylib2.rs
// ignore-musl

// pretty-expanded FIXME #23616

Expand Down
1 change: 1 addition & 0 deletions src/test/run-pass/linkage-visibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// aux-build:linkage-visibility.rs
// ignore-android: FIXME(#10379)
// ignore-windows: std::dynamic_lib does not work on Windows well
// ignore-musl

#![feature(std_misc)]

Expand Down
11 changes: 6 additions & 5 deletions src/test/run-pass/out-of-stack-new-thread-no-split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//ignore-android
//ignore-freebsd
//ignore-ios
//ignore-dragonfly
//ignore-bitrig
// ignore-android
// ignore-freebsd
// ignore-ios
// ignore-dragonfly
// ignore-bitrig
// ignore-musl

#![feature(asm)]

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/sepcomp-extern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

// Test accessing external items from multiple compilation units.

extern crate sepcomp_extern_lib;

#[link(name = "sepcomp_extern_lib")]
extern {
#[allow(ctypes)]
fn foo() -> usize;
Expand Down

0 comments on commit faa1a81

Please sign in to comment.