Browse Source

Migrate tests to `tempfile` from deprecated `tempdir` (#457)

master
silwol 5 years ago
committed by Alex Crichton
parent
commit
661800ed92
  1. 2
      Cargo.toml
  2. 4
      tests/support/mod.rs

2
Cargo.toml

@ -25,4 +25,4 @@ jobserver = { version = "0.1.16", optional = true }
parallel = ["num_cpus", "jobserver"]
[dev-dependencies]
tempdir = "0.3"
tempfile = "3"

4
tests/support/mod.rs

@ -8,7 +8,7 @@ use std::io::prelude::*;
use std::path::{Path, PathBuf};
use cc;
use tempdir::TempDir;
use tempfile::{Builder, TempDir};
pub struct Test {
pub td: TempDir,
@ -27,7 +27,7 @@ impl Test {
if gcc.ends_with("deps") {
gcc.pop();
}
let td = TempDir::new_in(&gcc, "gcc-test").unwrap();
let td = Builder::new().prefix("gcc-test").tempdir_in(&gcc).unwrap();
gcc.push(format!("gcc-shim{}", env::consts::EXE_SUFFIX));
Test {
td: td,

Loading…
Cancel
Save