run tests sequentially to avoid races
This commit is contained in:
parent
87be0c0c33
commit
8d4769ad2b
|
|
@ -14,7 +14,7 @@ lisp1.o: lisp1.asm
|
||||||
nasm -g -f elf64 -o lisp1.o lisp1.asm
|
nasm -g -f elf64 -o lisp1.o lisp1.asm
|
||||||
|
|
||||||
test1: test1.bin
|
test1: test1.bin
|
||||||
./test1.bin
|
./test1.bin --nocapture --test-threads=1
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f lisp.o test.bin lisp1.o test1.bin
|
rm -f lisp.o test.bin lisp1.o test1.bin
|
||||||
|
|
|
||||||
|
|
@ -250,61 +250,61 @@ mod tests {
|
||||||
use std::mem::ManuallyDrop;
|
use std::mem::ManuallyDrop;
|
||||||
use std::os::fd::AsRawFd;
|
use std::os::fd::AsRawFd;
|
||||||
|
|
||||||
// #[test]
|
#[test]
|
||||||
// fn test_heap_alloc_dealloc() {
|
fn test_heap_alloc_dealloc() {
|
||||||
// let small = Box::new_in(42u8, HeapAlloc);
|
let small = Box::new_in(42u8, HeapAlloc);
|
||||||
// let ptr_sized = Box::new_in(42usize, HeapAlloc);
|
let ptr_sized = Box::new_in(42usize, HeapAlloc);
|
||||||
// let big = Box::new_in([0u8; 48], HeapAlloc);
|
let big = Box::new_in([0u8; 48], HeapAlloc);
|
||||||
// let large = Box::new_in([0u8; 1024], HeapAlloc);
|
let large = Box::new_in([0u8; 1024], HeapAlloc);
|
||||||
// let page_sized = Box::new_in([0u8; 4096], HeapAlloc);
|
let page_sized = Box::new_in([0u8; 4096], HeapAlloc);
|
||||||
// assert_eq!(*small, 42);
|
assert_eq!(*small, 42);
|
||||||
// assert_ne!(
|
assert_ne!(
|
||||||
// Box::as_ptr(&small) as *const (),
|
Box::as_ptr(&small) as *const (),
|
||||||
// Box::as_ptr(&ptr_sized) as *const ()
|
Box::as_ptr(&ptr_sized) as *const ()
|
||||||
// );
|
);
|
||||||
// let small_ptr = Box::as_ptr(&small) as *const ();
|
let small_ptr = Box::as_ptr(&small) as *const ();
|
||||||
// drop(small);
|
drop(small);
|
||||||
// let small2 = Box::new_in(43u8, HeapAlloc);
|
let small2 = Box::new_in(43u8, HeapAlloc);
|
||||||
// assert_eq!(*small2, 43);
|
assert_eq!(*small2, 43);
|
||||||
// assert_eq!(small_ptr, Box::as_ptr(&small2) as *const ());
|
assert_eq!(small_ptr, Box::as_ptr(&small2) as *const ());
|
||||||
// }
|
}
|
||||||
|
|
||||||
// #[test]
|
#[test]
|
||||||
// fn source() {
|
fn source() {
|
||||||
// let mut file = std::fs::File::open("lisp1.asm").unwrap();
|
let mut file = std::fs::File::open("lisp1.asm").unwrap();
|
||||||
// unsafe {
|
unsafe {
|
||||||
// init_source(&raw mut IFILE, file.as_raw_fd());
|
init_source(&raw mut IFILE, file.as_raw_fd());
|
||||||
// let SourceIterResult { c, some } = getc();
|
let SourceIterResult { c, some } = getc();
|
||||||
// assert!(*some);
|
assert!(*some);
|
||||||
// assert_eq!(c, b'd');
|
assert_eq!(c, b'd');
|
||||||
// let SourceIterResult { c, some } = peekc();
|
let SourceIterResult { c, some } = peekc();
|
||||||
// assert!(*some);
|
assert!(*some);
|
||||||
// assert_eq!(c, b'e');
|
assert_eq!(c, b'e');
|
||||||
// let SourceIterResult { c, some } = getc();
|
let SourceIterResult { c, some } = getc();
|
||||||
// assert!(*some);
|
assert!(*some);
|
||||||
// assert_eq!(c, b'e');
|
assert_eq!(c, b'e');
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// #[test]
|
#[test]
|
||||||
// fn parse_list() {
|
fn parse_list() {
|
||||||
// let file = ManuallyDrop::new(File::open("tests/list.l").unwrap());
|
let file = ManuallyDrop::new(File::open("tests/list.l").unwrap());
|
||||||
// unsafe {
|
unsafe {
|
||||||
// init_source(&raw mut IFILE, file.as_raw_fd());
|
init_source(&raw mut IFILE, file.as_raw_fd());
|
||||||
// let obj = parse_next_token();
|
let obj = parse_next_token();
|
||||||
// println!("{:?}", obj);
|
println!("{:?}", obj);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// #[test]
|
#[test]
|
||||||
// fn parse_quoted_list() {
|
fn parse_quoted_list() {
|
||||||
// let file = ManuallyDrop::new(File::open("tests/quoted-list.l").unwrap());
|
let file = ManuallyDrop::new(File::open("tests/quoted-list.l").unwrap());
|
||||||
// unsafe {
|
unsafe {
|
||||||
// init_source(&raw mut IFILE, file.as_raw_fd());
|
init_source(&raw mut IFILE, file.as_raw_fd());
|
||||||
// let obj = parse_next_token();
|
let obj = parse_next_token();
|
||||||
// println!("{:?}", obj);
|
println!("{:?}", obj);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn parse_atom() {
|
fn parse_atom() {
|
||||||
|
|
@ -316,23 +316,23 @@ mod tests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// #[test]
|
#[test]
|
||||||
// fn parse_pair() {
|
fn parse_pair() {
|
||||||
// let file = ManuallyDrop::new(File::open("tests/pair.l").unwrap());
|
let file = ManuallyDrop::new(File::open("tests/pair.l").unwrap());
|
||||||
// unsafe {
|
unsafe {
|
||||||
// init_source(&raw mut IFILE, file.as_raw_fd());
|
init_source(&raw mut IFILE, file.as_raw_fd());
|
||||||
// let obj = parse_next_token();
|
let obj = parse_next_token();
|
||||||
// println!("{:?}", obj);
|
println!("{:?}", obj);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// #[test]
|
#[test]
|
||||||
// fn parse_big_number() {
|
fn parse_big_number() {
|
||||||
// let file = ManuallyDrop::new(File::open("tests/big-number.l").unwrap());
|
let file = ManuallyDrop::new(File::open("tests/big-number.l").unwrap());
|
||||||
// unsafe {
|
unsafe {
|
||||||
// init_source(&raw mut IFILE, file.as_raw_fd());
|
init_source(&raw mut IFILE, file.as_raw_fd());
|
||||||
// let obj = parse_next_token();
|
let obj = parse_next_token();
|
||||||
// println!("{:?}", obj);
|
println!("{:?}", obj);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue