@@ -1136,6 +1136,7 @@ fn testdir(builder: &Builder<'_>, host: TargetSelection) -> PathBuf {
1136
1136
/// Declares a test step that invokes compiletest on a particular test suite.
1137
1137
macro_rules! test {
1138
1138
(
1139
+ $( #[ $attr: meta] ) * // allow docstrings and attributes
1139
1140
$name: ident {
1140
1141
path: $path: expr,
1141
1142
mode: $mode: expr,
@@ -1146,6 +1147,7 @@ macro_rules! test {
1146
1147
$( , ) ? // optional trailing comma
1147
1148
}
1148
1149
) => {
1150
+ $( #[ $attr] ) *
1149
1151
#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
1150
1152
pub struct $name {
1151
1153
pub compiler: Compiler ,
@@ -1194,11 +1196,16 @@ macro_rules! test {
1194
1196
/// Declares an alias for running the [`Coverage`] tests in only one mode.
1195
1197
/// Adapted from [`test`].
1196
1198
macro_rules! coverage_test_alias {
1197
- ( $name: ident {
1198
- alias_and_mode: $alias_and_mode: expr, // &'static str
1199
- default : $default: expr, // bool
1200
- only_hosts: $only_hosts: expr $( , ) ? // bool
1201
- } ) => {
1199
+ (
1200
+ $( #[ $attr: meta] ) * // allow docstrings and attributes
1201
+ $name: ident {
1202
+ alias_and_mode: $alias_and_mode: expr, // &'static str
1203
+ default : $default: expr, // bool
1204
+ only_hosts: $only_hosts: expr // bool
1205
+ $( , ) ? // optional trailing comma
1206
+ }
1207
+ ) => {
1208
+ $( #[ $attr] ) *
1202
1209
#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
1203
1210
pub struct $name {
1204
1211
pub compiler: Compiler ,
@@ -1549,22 +1556,26 @@ impl Step for Coverage {
1549
1556
}
1550
1557
}
1551
1558
1552
- // Runs `tests/coverage` in "coverage-map" mode only.
1553
- // Used by `x test` and `x test coverage-map`.
1554
- coverage_test_alias ! ( CoverageMap {
1555
- alias_and_mode: "coverage-map" ,
1556
- default : true ,
1557
- only_hosts: false ,
1558
- } ) ;
1559
- // Runs `tests/coverage` in "coverage-run" mode only.
1560
- // Used by `x test` and `x test coverage-run`.
1561
- coverage_test_alias ! ( CoverageRun {
1562
- alias_and_mode: "coverage-run" ,
1563
- default : true ,
1564
- // Compiletest knows how to automatically skip these tests when cross-compiling,
1565
- // but skipping the whole step here makes it clearer that they haven't run at all.
1566
- only_hosts: true ,
1567
- } ) ;
1559
+ coverage_test_alias ! {
1560
+ /// Runs the `tests/coverage` test suite in "coverage-map" mode only.
1561
+ /// Used by `x test` and `x test coverage-map`.
1562
+ CoverageMap {
1563
+ alias_and_mode: "coverage-map" ,
1564
+ default : true ,
1565
+ only_hosts: false ,
1566
+ }
1567
+ }
1568
+ coverage_test_alias ! {
1569
+ /// Runs the `tests/coverage` test suite in "coverage-run" mode only.
1570
+ /// Used by `x test` and `x test coverage-run`.
1571
+ CoverageRun {
1572
+ alias_and_mode: "coverage-run" ,
1573
+ default : true ,
1574
+ // Compiletest knows how to automatically skip these tests when cross-compiling,
1575
+ // but skipping the whole step here makes it clearer that they haven't run at all.
1576
+ only_hosts: true ,
1577
+ }
1578
+ }
1568
1579
1569
1580
test ! ( CoverageRunRustdoc {
1570
1581
path: "tests/coverage-run-rustdoc" ,
0 commit comments