]> git.lizzy.rs Git - rust.git/commitdiff
Disable posix_fadvise test on macOS, not in libc
authorDavid Cook <divergentdave@gmail.com>
Wed, 29 Jan 2020 01:57:56 +0000 (19:57 -0600)
committerDavid Cook <divergentdave@gmail.com>
Wed, 29 Jan 2020 01:57:56 +0000 (19:57 -0600)
tests/run-pass/libc.rs

index 25f96b472b236c9b9abe8113ab769672d220c4fa..eb23cd16b757cd38a44dbf0c8e0846d7d89527b8 100644 (file)
@@ -5,13 +5,14 @@
 
 extern crate libc;
 
-use std::convert::TryInto;
-use std::env::temp_dir;
-use std::fs::{File, remove_file};
-use std::io::Write;
-use std::os::unix::io::AsRawFd;
+#[cfg(not(target_os = "macos"))]
+fn test_posix_fadvise() {
+    use std::convert::TryInto;
+    use std::env::temp_dir;
+    use std::fs::{File, remove_file};
+    use std::io::Write;
+    use std::os::unix::io::AsRawFd;
 
-fn main() {
     let path = temp_dir().join("miri_test_libc.txt");
     // Cleanup before test
     remove_file(&path).ok();
@@ -34,3 +35,8 @@ fn main() {
     remove_file(&path).unwrap();
     assert_eq!(result, 0);
 }
+
+fn main() {
+    #[cfg(not(target_os = "macos"))]
+    test_posix_fadvise();
+}