-
Notifications
You must be signed in to change notification settings - Fork 405
Commit 1bbaafd
authored
Rollup merge of #148724 - Zalathar:tidyselftest, r=jieyouxu
tidy: Don't bypass stderr output capture in unit tests
In unit tests, writes to stderr that don't use `eprint!` or `eprintln!` will not be captured, and instead interfere with test harness output, making it unreadable.
<details>
<summary><b>Detailed before/after</b></summary>
## Before
```text
$ x test tidyselftest --no-doc
Building bootstrap
Finished `dev` profile [unoptimized] target(s) in 0.03s
Testing stage1 tidy (aarch64-apple-darwin)
Compiling tidy v0.1.0 (/Users/stuart/Dev/rust/rust/src/tools/tidy)
Finished `release` profile [optimized + debuginfo] target(s) in 0.23s
Running unittests src/lib.rs (build/aarch64-apple-darwin/bootstrap-tools/aarch64-apple-darwin/release/deps/tidy-c33a0cc08cf46c66)
running 20 tests
tidy [alphabetical-test]: bad:3 found `tidy-alphabetical-start` expecting `tidy-alphabetical-end`
tidy [alphabetical-test]: FAIL
tidy [alphabetical-test]: bad: reached end of file expecting `tidy-alphabetical-end`tidy [alphabetical-test]: bad:4: line not in alphabetical order
tidy [alphabetical-test]: bad:5 found `tidy-alphabetical-end` expecting `tidy-alphabetical-start`
tidy [alphabetical-test]: FAIL
tidy [alphabetical-test]: FAIL
tidy [alphabetical-test].: tidy [alphabetical-test...bad:4: line not in alphabetical order..]: tidy [alphabetical-test]: ..
bad:7: line not in alphabetical order
tidy [tidy [bad:2 found `tidy-alphabetical-end` expecting `tidy-alphabetical-start`
alphabetical-testtidy [tidy [alphabetical-test]: bad:4: line not in alphabetical order
.tidy [alphabetical-test]..]alphabetical-testtidy []: bad:4: line not in alphabetical orderalphabetical-testalphabetical-test]: tidy [FAILalphabetical-test
]: FAIL
]: FAIL
: FAIL
: bad:4: line not in alphabetical order
tidy [alphabetical-test]: FAIL
tidy [.alphabetical-test]: FAIL
.tidy [alphabetical-test]: FAIL
..tidy [alphabetical-test]: bad:3: line not in alphabetical order
tidy [alphabetical-test]: FAIL
tidy [alphabetical-test]: bad:3: line not in alphabetical order
tidy [alphabetical-test]: FAIL
.....
test result: ok. 20 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.01ms
Running unittests src/main.rs (build/aarch64-apple-darwin/bootstrap-tools/aarch64-apple-darwin/release/deps/rust_tidy-25232a69af4dd751)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 26.88µs
finished in 0.255 seconds
Build completed successfully in 0:00:00
```
## After
```text
$ x test tidyselftest --no-doc
Building bootstrap
Finished `dev` profile [unoptimized] target(s) in 0.03s
Testing stage1 tidy (aarch64-apple-darwin)
Compiling tidy v0.1.0 (/Users/stuart/Dev/rust/rust/src/tools/tidy)
Finished `release` profile [optimized + debuginfo] target(s) in 1.74s
Running unittests src/lib.rs (build/aarch64-apple-darwin/bootstrap-tools/aarch64-apple-darwin/release/deps/tidy-c33a0cc08cf46c66)
running 20 tests
....................
test result: ok. 20 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.35ms
Running unittests src/main.rs (build/aarch64-apple-darwin/bootstrap-tools/aarch64-apple-darwin/release/deps/rust_tidy-25232a69af4dd751)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 27.17µs
finished in 1.764 seconds
Build completed successfully in 0:00:02
```
</details>File tree
Expand file treeCollapse file tree
0 file changed
+0
-0
lines changedOpen diff view settings
Filter options
Expand file treeCollapse file tree
0 file changed
+0
-0
lines changedOpen diff view settings
0 commit comments