From f0eb61436e62d0d0d755ac8280bf97b4b52d4e0b Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Thu, 6 Feb 2025 04:30:28 +0100 Subject: Get rid of server_no_stderr We'll now always just pipe the contents of the child to the parent. --- tests/fixtures/mod.rs | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'tests/fixtures/mod.rs') diff --git a/tests/fixtures/mod.rs b/tests/fixtures/mod.rs index a96a5b7..f95d4f6 100644 --- a/tests/fixtures/mod.rs +++ b/tests/fixtures/mod.rs @@ -121,34 +121,8 @@ where .arg("-p") .arg(port.to_string()) .args(args.clone()) - .stdout(Stdio::null()) - .spawn() - .expect("Couldn't run test binary"); - let is_tls = args - .into_iter() - .any(|x| x.as_ref().to_str().unwrap().contains("tls")); - - wait_for_port(port); - TestServer::new(port, tmpdir, child, is_tls) -} - -/// Same as `server()` but ignore stderr -#[fixture] -pub fn server_no_stderr(#[default(&[] as &[&str])] args: I) -> TestServer -where - I: IntoIterator + Clone, - I::Item: AsRef, -{ - let port = port(); - let tmpdir = tmpdir(); - let child = Command::cargo_bin("miniserve") - .expect("Couldn't find test binary") - .arg(tmpdir.path()) - .arg("-p") - .arg(port.to_string()) - .args(args.clone()) - .stdout(Stdio::null()) - .stderr(Stdio::null()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) .spawn() .expect("Couldn't run test binary"); let is_tls = args -- cgit v1.2.3