2020-01-02 15:13:47 -05:00
|
|
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
2019-10-09 17:22:22 -04:00
|
|
|
|
2019-11-15 13:31:53 -05:00
|
|
|
mod tests {
|
|
|
|
extern crate lazy_static;
|
|
|
|
extern crate tempfile;
|
2020-01-05 11:56:18 -05:00
|
|
|
use deno::test_util::*;
|
2019-11-15 13:31:53 -05:00
|
|
|
use std::process::Command;
|
|
|
|
use tempfile::TempDir;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn std_tests() {
|
|
|
|
let dir = TempDir::new().expect("tempdir fail");
|
|
|
|
let mut deno_cmd = Command::new(deno_exe_path());
|
|
|
|
deno_cmd.env("DENO_DIR", dir.path());
|
|
|
|
|
|
|
|
let mut cwd = root_path();
|
|
|
|
cwd.push("std");
|
|
|
|
let mut deno = deno_cmd
|
|
|
|
.current_dir(cwd) // note: std tests expect to run from "std" dir
|
2020-02-24 16:37:15 -05:00
|
|
|
.arg("--seed=86") // Some tests rely on specific random numbers.
|
2019-11-15 13:31:53 -05:00
|
|
|
.arg("-A")
|
|
|
|
// .arg("-Ldebug")
|
|
|
|
.arg("./testing/runner.ts")
|
|
|
|
.arg("--exclude=testing/testdata")
|
|
|
|
.spawn()
|
|
|
|
.expect("failed to spawn script");
|
|
|
|
let status = deno.wait().expect("failed to wait for the child process");
|
|
|
|
assert!(status.success());
|
|
|
|
}
|
2019-10-09 17:22:22 -04:00
|
|
|
}
|