libpanic_unwind: Unconfigure tests during normal build

This commit is contained in:
Vadim Petrochenkov 2019-08-01 02:52:30 +03:00
parent f53fc21ba0
commit 7d511cca5c
3 changed files with 22 additions and 19 deletions

View File

@ -6,6 +6,9 @@
// are compiling it everywhere to avoid regressions.
#![allow(unused)]
#[cfg(test)]
mod tests;
pub mod eh;
use core::mem;
@ -68,21 +71,3 @@ impl DwarfReader {
result as i64
}
}
#[test]
fn dwarf_reader() {
let encoded: &[u8] = &[1, 2, 3, 4, 5, 6, 7, 0xE5, 0x8E, 0x26, 0x9B, 0xF1, 0x59, 0xFF, 0xFF];
let mut reader = DwarfReader::new(encoded.as_ptr());
unsafe {
assert!(reader.read::<u8>() == u8::to_be(1u8));
assert!(reader.read::<u16>() == u16::to_be(0x0203));
assert!(reader.read::<u32>() == u32::to_be(0x04050607));
assert!(reader.read_uleb128() == 624485);
assert!(reader.read_sleb128() == -624485);
assert!(reader.read::<i8>() == i8::to_be(-1));
}
}

View File

@ -0,0 +1,19 @@
use super::*;
#[test]
fn dwarf_reader() {
let encoded: &[u8] = &[1, 2, 3, 4, 5, 6, 7, 0xE5, 0x8E, 0x26, 0x9B, 0xF1, 0x59, 0xFF, 0xFF];
let mut reader = DwarfReader::new(encoded.as_ptr());
unsafe {
assert!(reader.read::<u8>() == u8::to_be(1u8));
assert!(reader.read::<u16>() == u16::to_be(0x0203));
assert!(reader.read::<u32>() == u32::to_be(0x04050607));
assert!(reader.read_uleb128() == 624485);
assert!(reader.read_sleb128() == -624485);
assert!(reader.read::<i8>() == i8::to_be(-1));
}
}

View File

@ -27,7 +27,6 @@ pub fn check(root_path: &Path, bad: &mut bool) {
};
let fixme = [
"liballoc",
"libpanic_unwind/dwarf",
"librustc",
"librustc_data_structures",
"librustc_incremental/persist",