#[cfg(not(tarpaulin))] #[test] fn filesystem() -> Result<(), Box> { use std::process::{Command, Stdio}; let output = Command::new("cargo") .arg("run") .arg("-q") .arg("--offline") .arg("--example=filesystem") .arg("--") .arg("run") .stdout(Stdio::piped()) .output()?; let code = output.status.code().unwrap_or(0); assert_eq!(code, 1); let output = std::str::from_utf8(&output.stdout)?; assert!(output.contains("Wubba Lubba dub-dub")); assert!(output.contains("Panic")); assert!(output.contains("Stacktrace")); assert!(output.contains("read_metadata")); assert!(output.contains("Failed")); Ok(()) } #[cfg(not(tarpaulin))] #[test] fn webshop() -> Result<(), Box> { use std::process::{Command, Stdio}; let output = Command::new("cargo") .arg("run") .arg("-q") .arg("--offline") .arg("--example=webshop") .arg("--") .arg("run") .stdout(Stdio::piped()) .output()?; let code = output.status.code().unwrap_or(0); assert_eq!(code, 0); let output = std::str::from_utf8(&output.stdout)?; assert!(!output.contains("Panic")); assert!(!output.contains("Stacktrace")); assert!(output.contains("Total Tests")); assert!(output.contains("Successful")); Ok(()) }