From e2062e4943e823889f2a513be1217ba3a5add623 Mon Sep 17 00:00:00 2001 From: Anders429 Date: Fri, 9 Apr 2021 01:00:04 -0700 Subject: [PATCH 1/2] Set up separate Runners in different directories. --- Cargo.toml | 1 + src/run.rs | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 50f75e4..acce1ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,7 @@ diff = ["dissimilar"] dissimilar = { version = "1.0", optional = true } glob = "0.3" lazy_static = "1.3" +rustc-hash = { version = "1.1.0", default-features = false } serde = { version = "1.0.103", features = ["derive"] } serde_json = "1.0" termcolor = "1.0.4" diff --git a/src/run.rs b/src/run.rs index 8427c4c..12d0295 100644 --- a/src/run.rs +++ b/src/run.rs @@ -6,10 +6,12 @@ use crate::manifest::{Bin, Build, Config, Manifest, Name, Package, Workspace}; use crate::message::{self, Fail, Warn}; use crate::normalize::{self, Context, Variations}; use crate::{features, rustflags, Expected, Runner, Test}; +use rustc_hash::FxHasher; use std::collections::BTreeMap as Map; use std::env; use std::ffi::{OsStr, OsString}; use std::fs::{self, File}; +use std::hash::{Hash, Hasher}; use std::mem; use std::path::{Path, PathBuf}; @@ -109,7 +111,11 @@ impl Runner { .collect(); let mut project = Project { - dir: path!(target_dir / "tests" / crate_name), + dir: path!(target_dir / "tests" / crate_name / { + let mut hasher = FxHasher::default(); + self.tests.iter().map(|test| test.path.clone()).collect::>().hash(&mut hasher); + hasher.finish() + }.to_string()), source_dir, target_dir, name: format!("{}-tests", crate_name), From a552d98da1cd989bed7ad5e763235c5261b07ce7 Mon Sep 17 00:00:00 2001 From: Anders429 Date: Fri, 9 Apr 2021 01:25:37 -0700 Subject: [PATCH 2/2] Use DefaultHasher instead of FxHasher. --- Cargo.toml | 1 - src/run.rs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index acce1ce..50f75e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,6 @@ diff = ["dissimilar"] dissimilar = { version = "1.0", optional = true } glob = "0.3" lazy_static = "1.3" -rustc-hash = { version = "1.1.0", default-features = false } serde = { version = "1.0.103", features = ["derive"] } serde_json = "1.0" termcolor = "1.0.4" diff --git a/src/run.rs b/src/run.rs index 12d0295..ba1f237 100644 --- a/src/run.rs +++ b/src/run.rs @@ -6,8 +6,8 @@ use crate::manifest::{Bin, Build, Config, Manifest, Name, Package, Workspace}; use crate::message::{self, Fail, Warn}; use crate::normalize::{self, Context, Variations}; use crate::{features, rustflags, Expected, Runner, Test}; -use rustc_hash::FxHasher; use std::collections::BTreeMap as Map; +use std::collections::hash_map::DefaultHasher; use std::env; use std::ffi::{OsStr, OsString}; use std::fs::{self, File}; @@ -112,7 +112,7 @@ impl Runner { let mut project = Project { dir: path!(target_dir / "tests" / crate_name / { - let mut hasher = FxHasher::default(); + let mut hasher = DefaultHasher::new(); self.tests.iter().map(|test| test.path.clone()).collect::>().hash(&mut hasher); hasher.finish() }.to_string()),