From 3cccadcf0fbfc7ff4e7dd37299a65bea1cf0eab0 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Mon, 11 May 2020 20:20:14 +0200 Subject: Change plugin interface to prevent segfaults when unloading plugin (#5210) Fixes: #3473 Closes: #5193 --- test_plugin/tests/integration_tests.rs | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'test_plugin/tests/integration_tests.rs') diff --git a/test_plugin/tests/integration_tests.rs b/test_plugin/tests/integration_tests.rs index 2f61ec9aa..17002fc01 100644 --- a/test_plugin/tests/integration_tests.rs +++ b/test_plugin/tests/integration_tests.rs @@ -1,13 +1,26 @@ // To run this test manually: // cd test_plugin -// ../target/debug/deno --allow-plugin tests/test.js debug +// ../target/debug/deno run --unstable --allow-plugin tests/test.js debug -// 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; +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()) -- cgit v1.2.3