test: only execute `unix_echo` on Linux
// SPDX-License-Identifier: Apache-2.0
use enarx_exec_tests::musl_fsbase_fix;
-use std::io::{self, stdin, Read, Write};
-use std::os::unix::net::{UnixListener, UnixStream};
-use std::path::PathBuf;
musl_fsbase_fix!();
-fn main() -> io::Result<()> {
+#[cfg(unix)]
+fn main() -> std::io::Result<()> {
+ use std::io::{stdin, Read, Write};
+ use std::os::unix::net::{UnixListener, UnixStream};
+ use std::path::PathBuf;
+
let mut dir_name = String::new();
stdin().read_line(&mut dir_name)?;
@@ -24,3 +26,8 @@ fn main() -> io::Result<()> {
socket.write_all(&buffer)?;
Ok(())
}
+
+#[cfg(not(unix))]
+fn main() {
+ panic!("only supported on Unix")
+}
