Skip to content

Commit 3b88c9b

Browse files
authored
Add --no-fail-fast to compiletest (#2145)
Compiletest behavior has changed to always failing fast after #2045. This PR introduces a --no-fail-fast flag to compiletest which will execute the entire suite regardless of failure. The regression script uses --no-fail-fast so all failures in a suite are printed as part of the CI.
1 parent 55fe61c commit 3b88c9b

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

scripts/kani-regression.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ for testp in "${TESTS[@]}"; do
7474
suite=${testl[0]}
7575
mode=${testl[1]}
7676
echo "Check compiletest suite=$suite mode=$mode"
77-
cargo run -p compiletest --quiet -- --suite $suite --mode $mode --quiet
77+
cargo run -p compiletest --quiet -- --suite $suite --mode $mode \
78+
--quiet --no-fail-fast
7879
done
7980

8081
# Check codegen for the standard library

tools/compiletest/src/common.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ pub struct Config {
134134
/// Timeout duration for each test.
135135
pub timeout: Option<Duration>,
136136

137+
/// Whether we will abort execution when a failure occurs.
138+
/// When set to false, this will execute the entire test suite regardless of any failure.
139+
pub fail_fast: bool,
140+
137141
/// Whether we will run the tests or not.
138142
pub dry_run: bool,
139143
}

tools/compiletest/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
8686
.optflag("h", "help", "show this message")
8787
.optopt("", "edition", "default Rust edition", "EDITION")
8888
.optopt("", "timeout", "the timeout for each test in seconds", "TIMEOUT")
89+
.optflag("", "no-fail-fast", "run all tests regardless of failure")
8990
.optflag("", "dry-run", "don't actually run the tests")
9091
;
9192

@@ -157,6 +158,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
157158
color,
158159
edition: matches.opt_str("edition"),
159160
force_rerun: matches.opt_present("force-rerun"),
161+
fail_fast: !matches.opt_present("no-fail-fast"),
160162
dry_run: matches.opt_present("dry-run"),
161163
timeout,
162164
}
@@ -176,6 +178,8 @@ pub fn log_config(config: &Config) {
176178
logv(c, format!("verbose: {}", config.verbose));
177179
logv(c, format!("quiet: {}", config.quiet));
178180
logv(c, format!("timeout: {:?}", config.timeout));
181+
logv(c, format!("fail-fast: {:?}", config.fail_fast));
182+
logv(c, format!("dry-run: {:?}", config.dry_run));
179183
logv(
180184
c,
181185
format!(
@@ -285,7 +289,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
285289
list: false,
286290
options: test::Options::new(),
287291
time_options: None,
288-
fail_fast: true,
292+
fail_fast: config.fail_fast,
289293
force_run_in_process: false,
290294
}
291295
}

0 commit comments

Comments
 (0)