Skip to content

Commit 0106ad4

Browse files
authored
Rollup merge of #76000 - richkadel:llvm-coverage-map-gen-6b.2, r=wesleywiser
Adds --bless support to test/run-make-fulldeps The ability to "bless" output for some of these tests is critical to making it practical to adapt tests to unrelated changes. This is needed for new coverage tests, as shown in PR #76004 . r? @tmandry FYI: @wesleywiser
2 parents 35496c2 + 55cd243 commit 0106ad4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/tools/compiletest/src/runtest.rs

+12
Original file line numberDiff line numberDiff line change
@@ -2782,6 +2782,18 @@ impl<'test> TestCx<'test> {
27822782
cmd.env("RUSTFLAGS", "-Ctarget-feature=-crt-static").env("IS_MUSL_HOST", "1");
27832783
}
27842784

2785+
if self.config.bless {
2786+
cmd.env("RUSTC_BLESS_TEST", "--bless");
2787+
// Assume this option is active if the environment variable is "defined", with _any_ value.
2788+
// As an example, a `Makefile` can use this option by:
2789+
//
2790+
// ifdef RUSTC_BLESS_TEST
2791+
// cp "$(TMPDIR)"/actual_something.ext expected_something.ext
2792+
// else
2793+
// $(DIFF) expected_something.ext "$(TMPDIR)"/actual_something.ext
2794+
// endif
2795+
}
2796+
27852797
if self.config.target.contains("msvc") && self.config.cc != "" {
27862798
// We need to pass a path to `lib.exe`, so assume that `cc` is `cl.exe`
27872799
// and that `lib.exe` lives next to it.

0 commit comments

Comments
 (0)