zebra/zebrad/tests/acceptance.rs

31 lines
1.0 KiB
Rust
Raw Normal View History

//! Acceptance test: runs the application as a subprocess and asserts its
//! output for given argument combinations matches what is expected.
//!
//! Modify and/or delete these as you see fit to test the specific needs of
//! your application.
//!
//! For more information, see:
//! <https://docs.rs/abscissa_core/latest/abscissa_core/testing/index.html>
#![deny(warnings, missing_docs, trivial_casts, unused_qualifications)]
#![forbid(unsafe_code)]
use abscissa_core::testing::prelude::*;
2019-12-20 11:20:04 -08:00
use once_cell::sync::Lazy;
2019-12-20 11:20:04 -08:00
/// Executes your application binary via `cargo run`.
pub static RUNNER: Lazy<CmdRunner> = Lazy::new(|| CmdRunner::default());
2020-01-15 11:55:11 -08:00
/*
* Disabled pending tracing config rework, so that merging abscissa fixes doesn't block on this
* test failing because there's tracing output.
*
/// Example of a test which matches a regular expression
#[test]
fn version_no_args() {
let mut runner = RUNNER.clone();
let mut cmd = runner.arg("version").capture_stdout().run();
cmd.stdout().expect_regex(r"\A\w+ [\d\.\-]+\z");
}
2020-01-15 11:55:11 -08:00
*/