Skip to content

Commit 3ef7f91

Browse files
committed
bless cargo-miri output
I think cargo has a bug here: rust-lang/cargo#11191 but for now we bless its output so that we can keep CI green
1 parent dc0faf3 commit 3ef7f91

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -435,11 +435,10 @@ Moreover, Miri recognizes some environment variables:
435435
purpose.
436436
* `MIRI_NO_STD` (recognized by `cargo miri` and the test suite) makes sure that the target's
437437
sysroot is built without libstd. This allows testing and running no_std programs.
438-
* `MIRI_BLESS` (recognized by the test suite) overwrite all `stderr` and `stdout` files
439-
instead of checking whether the output matches.
440-
* `MIRI_SKIP_UI_CHECKS` (recognized by the test suite) don't check whether the
441-
`stderr` or `stdout` files match the actual output. Useful for the rustc test suite
442-
which has subtle differences that we don't care about.
438+
* `MIRI_BLESS` (recognized by the test suite and `cargo-miri-test/run-test.py`): overwrite all
439+
`stderr` and `stdout` files instead of checking whether the output matches.
440+
* `MIRI_SKIP_UI_CHECKS` (recognized by the test suite): don't check whether the
441+
`stderr` or `stdout` files match the actual output.
443442

444443
The following environment variables are *internal* and must not be used by
445444
anyone but Miri itself. They are used to communicate between different Miri

test-cargo-miri/run-test.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ def normalize_stderr(str):
3333
return str
3434

3535
def check_output(actual, path, name):
36+
if 'MIRI_BLESS' in os.environ:
37+
open(path, mode='w').write(actual)
38+
return True
3639
expected = open(path).read()
3740
if expected == actual:
3841
return True
39-
print(f"{path} did not match reference!")
42+
print(f"{name} output did not match reference in {path}!")
4043
print(f"--- BEGIN diff {name} ---")
4144
for text in difflib.unified_diff(expected.split("\n"), actual.split("\n")):
4245
print(text)

test-cargo-miri/test.filter.cross-target.stdout.ref

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11

2+
running 0 tests
3+
4+
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
5+
6+
27
running 0 tests
38

49
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out
+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11

2+
running 0 tests
3+
4+
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
5+
6+
27
running 0 tests
38

49
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out
@@ -10,8 +15,3 @@ test simple ... ok
1015

1116
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out
1217

13-
14-
running 0 tests
15-
16-
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in $TIME
17-

0 commit comments

Comments
 (0)