From c6a526f99cc623a8f8a7419f23d1d02cd4334c2e Mon Sep 17 00:00:00 2001 From: sharkdp Date: Fri, 2 Nov 2018 18:33:06 +0100 Subject: Run 'cargo run' only once --- tests/integration_tests.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index c30c2cac..3102cb13 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -1,10 +1,22 @@ extern crate assert_cmd; +extern crate escargot; +#[macro_use] +extern crate lazy_static; use assert_cmd::prelude::*; +use escargot::CargoRun; use std::process::Command; +lazy_static! { + static ref CARGO_RUN: CargoRun = escargot::CargoBuild::new() + .bin("bat") + .current_release() + .run() + .unwrap(); +} + fn bat_with_config() -> Command { - let mut cmd = Command::main_binary().unwrap(); + let mut cmd = CARGO_RUN.command(); cmd.current_dir("tests/examples"); cmd.env_remove("PAGER"); cmd.env_remove("BAT_PAGER"); -- cgit v1.2.3