Skip to content

Commit 1bf0eb0

Browse files
committed
Allow limiting the number of threads running in parallel
1 parent 263477b commit 1bf0eb0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/compiletest.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use colored::*;
22
use regex::bytes::Regex;
33
use std::ffi::OsString;
4+
use std::num::NonZeroUsize;
45
use std::path::{Path, PathBuf};
56
use std::{env, process::Command};
67
use ui_test::{color_eyre::Result, Config, Match, Mode, OutputConflictHandling};
@@ -128,7 +129,10 @@ fn run_tests(mode: Mode, path: &str, target: &str, with_dependencies: bool) -> R
128129
eprintln!(" Compiler: {}", config.program.display());
129130
ui_test::run_tests_generic(
130131
vec![config],
131-
std::thread::available_parallelism().unwrap(),
132+
std::env::var("MIRI_TEST_THREADS").map_or_else(
133+
|_| std::thread::available_parallelism().unwrap(),
134+
|threads| NonZeroUsize::new(threads.parse().unwrap()).unwrap(),
135+
),
132136
args,
133137
// The files we're actually interested in (all `.rs` files).
134138
ui_test::default_file_filter,

0 commit comments

Comments
 (0)