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
This commit is contained in:
Pietro Albini 2020-08-28 10:24:12 +02:00 committed by GitHub
commit 0106ad4e27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2782,6 +2782,18 @@ impl<'test> TestCx<'test> {
cmd.env("RUSTFLAGS", "-Ctarget-feature=-crt-static").env("IS_MUSL_HOST", "1");
}
if self.config.bless {
cmd.env("RUSTC_BLESS_TEST", "--bless");
// Assume this option is active if the environment variable is "defined", with _any_ value.
// As an example, a `Makefile` can use this option by:
//
// ifdef RUSTC_BLESS_TEST
// cp "$(TMPDIR)"/actual_something.ext expected_something.ext
// else
// $(DIFF) expected_something.ext "$(TMPDIR)"/actual_something.ext
// endif
}
if self.config.target.contains("msvc") && self.config.cc != "" {
// We need to pass a path to `lib.exe`, so assume that `cc` is `cl.exe`
// and that `lib.exe` lives next to it.