Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed May 11, 2020
1 parent 3b03d7d commit 332bde9
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions test_plugin/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,35 @@
// TODO(ry) Re-enable this test on windows. It is flaky for an unknown reason.
#![cfg(not(windows))]

use deno::test_util::*;
use std::path::PathBuf;
use std::process::Command;

#[cfg(debug_assertions)]
const BUILD_VARIANT: &str = "debug";

#[cfg(not(debug_assertions))]
const BUILD_VARIANT: &str = "release";

fn deno_cmd() -> Command {
assert!(deno_exe_path().exists());
Command::new(deno_exe_path())
}

#[cfg(debug_assertions)]
const BUILD_VARIANT: &str = "debug";
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()
}

#[cfg(not(debug_assertions))]
const BUILD_VARIANT: &str = "release";
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
}

#[test]
fn basic() {
Expand Down

0 comments on commit 332bde9

Please sign in to comment.