make RUSTC_BLESS entirely an internal thing

This commit is contained in:
Ralf Jung 2024-05-09 11:21:10 +02:00
parent e16f46cdab
commit cb44843900
3 changed files with 4 additions and 3 deletions

View file

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

View file

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

View file

@ -36,7 +36,7 @@ def normalize_stdout(str):
return str
def check_output(actual, path, name):
if os.environ.get("RUSTC_BLESS", "0") != "0":
if ARGS.bless:
# Write the output only if bless is set
open(path, mode='w').write(actual)
return True
@ -185,6 +185,7 @@ def test_cargo_miri_test():
args_parser = argparse.ArgumentParser(description='`cargo miri` testing')
args_parser.add_argument('--target', help='the target to test')
args_parser.add_argument('--bless', help='bless the reference files', action='store_true')
ARGS = args_parser.parse_args()
os.chdir(os.path.dirname(os.path.realpath(__file__)))