Skip to content

Commit cb44843

Browse files
committed
make RUSTC_BLESS entirely an internal thing
1 parent e16f46c commit cb44843

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/tools/miri/CONTRIBUTING.md

+2
Original file line numberDiff line numberDiff line change
@@ -322,3 +322,5 @@ binaries, and as such worth documenting:
322322
perform verbose logging.
323323
* `MIRI_HOST_SYSROOT` is set by bootstrap to tell `cargo-miri` which sysroot to use for *host*
324324
operations.
325+
* `RUSTC_BLESS` is set by `./miri test` (and `./x.py test miri`) to indicate bless-mode to the test
326+
harness.

src/tools/miri/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,6 @@ by all intended entry points, i.e. `cargo miri` and `./miri {test,run}`):
468468
* `MIRI_NO_STD` makes sure that the target's sysroot is built without libstd. This allows testing
469469
and running no_std programs. (Miri has a heuristic to detect no-std targets based on the target
470470
name; this environment variable is only needed when that heuristic fails.)
471-
* `RUSTC_BLESS` (recognized by `./miri test` and `cargo-miri-test/run-test.py`): overwrite all
472-
`stderr` and `stdout` files instead of checking whether the output matches.
473471
* `MIRI_SKIP_UI_CHECKS` (recognized by `./miri test`): don't check whether the
474472
`stderr` or `stdout` files match the actual output.
475473

src/tools/miri/test-cargo-miri/run-test.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def normalize_stdout(str):
3636
return str
3737

3838
def check_output(actual, path, name):
39-
if os.environ.get("RUSTC_BLESS", "0") != "0":
39+
if ARGS.bless:
4040
# Write the output only if bless is set
4141
open(path, mode='w').write(actual)
4242
return True
@@ -185,6 +185,7 @@ def test_cargo_miri_test():
185185

186186
args_parser = argparse.ArgumentParser(description='`cargo miri` testing')
187187
args_parser.add_argument('--target', help='the target to test')
188+
args_parser.add_argument('--bless', help='bless the reference files', action='store_true')
188189
ARGS = args_parser.parse_args()
189190

190191
os.chdir(os.path.dirname(os.path.realpath(__file__)))

0 commit comments

Comments
 (0)