mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-25 17:23:39 +01:00
Run 'cargo run' only once
This commit is contained in:
parent
278d841408
commit
c6a526f99c
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -66,6 +66,7 @@ dependencies = [
|
|||||||
"directories 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"directories 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
"encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"escargot 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"git2 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"git2 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"shell-words 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"shell-words 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -49,6 +49,7 @@ features = []
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempdir = "0.3"
|
tempdir = "0.3"
|
||||||
assert_cmd = "0.10.1"
|
assert_cmd = "0.10.1"
|
||||||
|
escargot = "0.3.1"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
clap = "2.32"
|
clap = "2.32"
|
||||||
|
@ -1,10 +1,22 @@
|
|||||||
extern crate assert_cmd;
|
extern crate assert_cmd;
|
||||||
|
extern crate escargot;
|
||||||
|
#[macro_use]
|
||||||
|
extern crate lazy_static;
|
||||||
|
|
||||||
use assert_cmd::prelude::*;
|
use assert_cmd::prelude::*;
|
||||||
|
use escargot::CargoRun;
|
||||||
use std::process::Command;
|
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 {
|
fn bat_with_config() -> Command {
|
||||||
let mut cmd = Command::main_binary().unwrap();
|
let mut cmd = CARGO_RUN.command();
|
||||||
cmd.current_dir("tests/examples");
|
cmd.current_dir("tests/examples");
|
||||||
cmd.env_remove("PAGER");
|
cmd.env_remove("PAGER");
|
||||||
cmd.env_remove("BAT_PAGER");
|
cmd.env_remove("BAT_PAGER");
|
||||||
|
Loading…
Reference in New Issue
Block a user