bless cargo-miri output

I think cargo has a bug here: https://github.com/rust-lang/cargo/issues/11191
but for now we bless its output so that we can keep CI green
This commit is contained in:
Ralf Jung 2022-10-08 09:04:54 +02:00
parent 58b13b7b88
commit 5243ae96fe
4 changed files with 18 additions and 11 deletions

View file

@ -435,11 +435,10 @@ Moreover, Miri recognizes some environment variables:
purpose.
* `MIRI_NO_STD` (recognized by `cargo miri` and the test suite) makes sure that the target's
sysroot is built without libstd. This allows testing and running no_std programs.
* `MIRI_BLESS` (recognized by the test suite) overwrite all `stderr` and `stdout` files
instead of checking whether the output matches.
* `MIRI_SKIP_UI_CHECKS` (recognized by the test suite) don't check whether the
`stderr` or `stdout` files match the actual output. Useful for the rustc test suite
which has subtle differences that we don't care about.
* `MIRI_BLESS` (recognized by the test suite 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 the test suite): don't check whether the
`stderr` or `stdout` files match the actual output.
The following environment variables are *internal* and must not be used by
anyone but Miri itself. They are used to communicate between different Miri

View file

@ -33,10 +33,13 @@ def normalize_stderr(str):
return str
def check_output(actual, path, name):
if 'MIRI_BLESS' in os.environ:
open(path, mode='w').write(actual)
return True
expected = open(path).read()
if expected == actual:
return True
print(f"{path} did not match reference!")
print(f"{name} output did not match reference in {path}!")
print(f"--- BEGIN diff {name} ---")
for text in difflib.unified_diff(expected.split("\n"), actual.split("\n")):
print(text)

View file

@ -1,4 +1,9 @@
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out

View file

@ -1,4 +1,9 @@
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out
@ -10,8 +15,3 @@ test simple ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in $TIME