@@ -29,16 +29,25 @@ rough heuristics:
29
29
- need to run gdb or lldb? use the ` debuginfo ` test suite
30
30
- need to inspect LLVM IR or MIR IR? use the ` codegen ` or ` mir-opt ` test
31
31
suites
32
- - need to run rustdoc? Prefer a ` rustdoc ` or ` rustdoc-ui ` test. Occasionally you'll need ` rustdoc-js ` as well.
32
+ - need to run rustdoc? Prefer a ` rustdoc ` or ` rustdoc-ui ` test.
33
+ Occasionally you'll need ` rustdoc-js ` as well.
33
34
- need to inspect the resulting binary in some way? Then use ` run-make `
34
- - Library tests should go in ` library/$crate/tests ` (where ` $crate ` is usually ` core ` , ` alloc ` , or ` std ` ).
35
- - For most other things, [ a ` ui ` (or ` ui-fulldeps ` ) test] ( #ui ) is to be
36
- preferred:
37
- - ` ui ` tests subsume both ` run-pass ` , ` compile-fail ` , and ` parse-fail ` tests
35
+ - Library tests should go in ` library/${crate}/tests ` (where ` ${crate} ` is
36
+ usually ` core ` , ` alloc ` , or ` std ` ). Library tests include:
37
+ - tests that an API behaves properly, including accepting various types or
38
+ having some runtime behavior
39
+ - tests where any compiler warnings are not relevant to the test
40
+ - tests that a use of an API gives a compile error, where the exact error
41
+ message is not relevant to the test. These should have an
42
+ [ error number] ( `E0XXX` ) in the code block to make sure it's the correct error.
43
+ - For most other things, [ a ` ui ` (or ` ui-fulldeps ` ) test] ( #ui ) is to be preferred:
44
+ - [ ` ui ` ] ( #ui ) tests subsume both ` run-pass ` , ` compile-fail ` , and ` parse-fail ` tests
38
45
- in the case of warnings or errors, ` ui ` tests capture the full output,
39
46
which makes it easier to review but also helps prevent "hidden" regressions
40
47
in the output
41
48
49
+ [ error number ] : https://doc.rust-lang.org/rustdoc/unstable-features.html#error-numbers-for-compile-fail-doctests
50
+
42
51
## Naming your test
43
52
44
53
We have not traditionally had a lot of structure in the names of
0 commit comments