mirror of
https://github.com/sharkdp/bat.git
synced 2025-08-17 03:23:14 +02:00
Run 'cargo run' only once
This commit is contained in:
@ -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");
|
||||
|
Reference in New Issue
Block a user