summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorsharkdp <davidpeter@web.de>2018-11-02 18:33:06 +0100
committerDavid Peter <sharkdp@users.noreply.github.com>2018-11-04 12:24:56 +0100
commitc6a526f99cc623a8f8a7419f23d1d02cd4334c2e (patch)
tree0068c589ac6dc37bfc1593c12830e0f0bff6d822 /tests
parent278d84140864c65f91ec7a3d19741bcc94987b45 (diff)
Run 'cargo run' only once
Diffstat (limited to 'tests')
-rw-r--r--tests/integration_tests.rs14
1 files changed, 13 insertions, 1 deletions
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");