From 90c5dcfe79cd010b429e775a3ebcb3c5d78fa6ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 18 Jun 2020 17:54:55 +0200 Subject: chore(test): move testing utilities to test_util crate (#6360) --- test_plugin/Cargo.toml | 3 +++ test_plugin/tests/integration_tests.rs | 23 +---------------------- 2 files changed, 4 insertions(+), 22 deletions(-) (limited to 'test_plugin') diff --git a/test_plugin/Cargo.toml b/test_plugin/Cargo.toml index 3787579a8..ca86b96e9 100644 --- a/test_plugin/Cargo.toml +++ b/test_plugin/Cargo.toml @@ -11,3 +11,6 @@ crate-type = ["cdylib"] [dependencies] futures = "0.3.5" deno_core = { path = "../core" } + +[dev-dependencies] +test_util = { path = "../test_util" } \ No newline at end of file diff --git a/test_plugin/tests/integration_tests.rs b/test_plugin/tests/integration_tests.rs index 8716048b1..53d1c2441 100644 --- a/test_plugin/tests/integration_tests.rs +++ b/test_plugin/tests/integration_tests.rs @@ -2,29 +2,8 @@ // cd test_plugin // ../target/debug/deno run --unstable --allow-plugin tests/test.js debug -use std::path::PathBuf; use std::process::Command; - -fn target_dir() -> PathBuf { - let current_exe = std::env::current_exe().unwrap(); - let target_dir = current_exe.parent().unwrap().parent().unwrap(); - println!("target_dir {}", target_dir.display()); - target_dir.into() -} - -fn deno_exe_path() -> PathBuf { - // Something like /Users/rld/src/deno/target/debug/deps/deno - let mut p = target_dir().join("deno"); - if cfg!(windows) { - p.set_extension("exe"); - } - p -} - -fn deno_cmd() -> Command { - assert!(deno_exe_path().exists()); - Command::new(deno_exe_path()) -} +use test_util::deno_cmd; #[cfg(debug_assertions)] const BUILD_VARIANT: &str = "debug"; -- cgit v1.2.3