diff --git a/ar_test.rs b/ar_test.rs deleted file mode 100644 index 567b2f04d2a..00000000000 --- a/ar_test.rs +++ /dev/null @@ -1,45 +0,0 @@ -//! ```cargo -//! [dependencies] -//! ar = "0.6.2" -//! ``` - -use std::io::Read; - -// 64 gives Invalid file size field in entry header -// 32 gives unexpected EOF in the middle of archive entry header -const METADATA_LEN: usize = 64; - -fn main() { - let mut builder = ar::Builder::new(std::fs::File::create("test.a").expect("create")); - - // Remove this append and there is no problem. - let header = ar::Header::new(b"core-fc675.rcgu.o".to_vec(), 0); - // Remove any of the characters in the filename and ! from will show up in the error message. - // Making it shorter than 17 chars will fix the problem though. - - builder.append(&header, &mut (&[] as &[u8])).expect("add rcgu"); - - let mut buf: Vec = vec!['!' as u8; 28]; - buf.extend(b"hello worl"); - buf.extend(&['*' as u8; 26] as &[u8]); - assert!(buf.len() >= METADATA_LEN); - - let header = ar::Header::new(b"rust.metadata.bin".to_vec(), METADATA_LEN as u64); - builder.append(&header, &mut (&buf[0..METADATA_LEN])).expect("add meta"); - - std::mem::drop(builder); - - // Remove this ranlib invocation and there is no problem. - /*assert!( - std::process::Command::new("ranlib") - .arg("test.a") - .status() - .expect("Couldn't run ranlib") - .success() - );*/ - - let mut archive = ar::Archive::new(std::fs::File::open("test.a").expect("open")); - while let Some(entry) = archive.next_entry() { - entry.unwrap(); - } -} diff --git a/test.sh b/test.sh index 20f4a6bd1f4..1dfbf924754 100755 --- a/test.sh +++ b/test.sh @@ -5,7 +5,7 @@ rm -r target/out || true mkdir -p target/out/clif echo "[BUILD] mini_core" -$RUSTC example/mini_core.rs --crate-name mini_core --crate-type dylib -Csave-temps +$RUSTC example/mini_core.rs --crate-name mini_core --crate-type dylib echo "[BUILD] example" $RUSTC example/example.rs --crate-type lib