summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration_tests.rs23
1 files changed, 10 insertions, 13 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index a7e901d83..e57b682c5 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -176,8 +176,9 @@ fn no_color() {
pub fn test_raw_tty() {
use std::io::{Read, Write};
use util::pty::fork::*;
+
let deno_exe = util::deno_exe_path();
- let deno_dir = TempDir::new().expect("tempdir fail");
+ let root_path = util::root_path();
let fork = Fork::from_ptmx().unwrap();
if let Ok(mut master) = fork.is_parent() {
@@ -193,10 +194,10 @@ pub fn test_raw_tty() {
master.write_all(b"c").unwrap();
nread = master.read(&mut obytes).unwrap();
assert_eq!(String::from_utf8_lossy(&obytes[0..nread]), "C");
+ fork.wait().unwrap();
} else {
use nix::sys::termios;
use std::os::unix::io::AsRawFd;
- use std::process::*;
// Turn off echo such that parent is reading works properly.
let stdin_fd = std::io::stdin().as_raw_fd();
@@ -204,20 +205,16 @@ pub fn test_raw_tty() {
t.local_flags.remove(termios::LocalFlags::ECHO);
termios::tcsetattr(stdin_fd, termios::SetArg::TCSANOW, &t).unwrap();
- let mut child = Command::new(deno_exe)
- .env("DENO_DIR", deno_dir.path())
- .current_dir(util::root_path())
+ std::env::set_current_dir(root_path).unwrap();
+ let err = exec::Command::new(deno_exe)
.arg("run")
.arg("--unstable")
+ .arg("--quiet")
+ .arg("--no-check")
.arg("cli/tests/raw_mode.ts")
- .stdin(Stdio::inherit())
- .stdout(Stdio::inherit())
- // Warning: errors may be swallowed. Try to comment stderr null if
- // experiencing problems.
- .stderr(Stdio::null())
- .spawn()
- .expect("Failed to spawn script");
- child.wait().unwrap();
+ .exec();
+ println!("err {}", err);
+ unreachable!()
}
}