Run 'cargo run' only once

This commit is contained in:
sharkdp authored and David Peter committed 2018-11-04 12:24:56 +01:00
1 parent 278d841408
commit c6a526f99c
3 files changed
+15 -1

No files matched your search

+13 -1
View File
@@ -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");