@@ -521,6 +521,43 @@ only running the main `coverage` suite.
521
521
[ `src/tools/coverage-dump` ] : https://github.com/rust-lang/rust/tree/master/src/tools/coverage-dump
522
522
[ `tests/coverage-run-rustdoc` ] : https://github.com/rust-lang/rust/tree/master/tests/coverage-run-rustdoc
523
523
524
+ ### Crashes tests
525
+
526
+ [ ` tests/crashes ` ] serve as a collection of tests that are expected to cause the compiler to ICE, panic
527
+ or crash in some other way, so that accidental fixes are tracked. This was formally done at
528
+ < https://github.com/rust-lang/glacier > but doing it inside the rust-lang/rust testsuite is more
529
+ convenient.
530
+
531
+ It is imperative that a test in the suite causes rustc to ICE, panic or crash crash in some other
532
+ way. A test will "pass" if rustc exits with an exit status other than 1 or 0.
533
+
534
+ If you want to see verbose stdout/stderr, you need to set ` COMPILETEST_VERBOSE_CRASHES=1 ` , e.g.
535
+
536
+ ``` bash
537
+ $ COMPILETEST_VERBOSE_CRASHES=1 ./x test tests/crashes/999999.rs --stage 1
538
+ ```
539
+
540
+ When adding crashes from < https://github.com/rust-lang/rust/issues > , the issue number should be
541
+ noted in the file name (` 12345.rs ` should suffice) and also inside the file include a `//@ known-bug
542
+ #4321 ` directive.
543
+
544
+ If you happen to fix one of the crashes, please move it to a fitting subdirectory in ` tests/ui ` and
545
+ give it a meaningful name. Please add a doc comment at the top of the file explaining why this test
546
+ exists, even better if you can briefly explain how the example causes rustc to crash previously and
547
+ what was done to prevent rustc to ICE/panic/crash.
548
+
549
+ Adding
550
+
551
+ ``` text
552
+ Fixes #NNNNN
553
+ Fixes #MMMMM
554
+ ```
555
+
556
+ to the description of your pull request will ensure the corresponding tickets be closed
557
+ automatically upon merge. The ticket ids can be found in the file name or the ` //@ known-bug `
558
+ directive inside the test file.
559
+
560
+ [ `tests/crashes` ] : https://github.com/rust-lang/rust/tree/master/tests/crashes
524
561
525
562
## Building auxiliary crates
526
563
0 commit comments