@@ -1305,6 +1305,47 @@ macro_rules! test_definitions {
1305
1305
} ;
1306
1306
}
1307
1307
1308
+ /// Declares an alias for running the [`Coverage`] tests in only one mode.
1309
+ /// Adapted from [`test_definitions`].
1310
+ macro_rules! coverage_test_alias {
1311
+ ( $name: ident {
1312
+ alias_and_mode: $alias_and_mode: expr,
1313
+ default : $default: expr,
1314
+ only_hosts: $only_hosts: expr $( , ) ?
1315
+ } ) => {
1316
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
1317
+ pub struct $name {
1318
+ pub compiler: Compiler ,
1319
+ pub target: TargetSelection ,
1320
+ }
1321
+
1322
+ impl $name {
1323
+ const MODE : & ' static str = $alias_and_mode;
1324
+ }
1325
+
1326
+ impl Step for $name {
1327
+ type Output = ( ) ;
1328
+ const DEFAULT : bool = $default;
1329
+ const ONLY_HOSTS : bool = $only_hosts;
1330
+
1331
+ fn should_run( run: ShouldRun <' _>) -> ShouldRun <' _> {
1332
+ run. alias( $alias_and_mode)
1333
+ }
1334
+
1335
+ fn make_run( run: RunConfig <' _>) {
1336
+ let compiler = run. builder. compiler( run. builder. top_stage, run. build_triple( ) ) ;
1337
+
1338
+ run. builder. ensure( $name { compiler, target: run. target } ) ;
1339
+ }
1340
+
1341
+ fn run( self , builder: & Builder <' _>) {
1342
+ Coverage { compiler: self . compiler, target: self . target }
1343
+ . run_unified_suite( builder, Self :: MODE )
1344
+ }
1345
+ }
1346
+ } ;
1347
+ }
1348
+
1308
1349
default_test ! ( Ui { path: "tests/ui" , mode: "ui" , suite: "ui" } ) ;
1309
1350
1310
1351
default_test ! ( RunPassValgrind {
@@ -1361,7 +1402,19 @@ pub struct Coverage {
1361
1402
}
1362
1403
1363
1404
impl Coverage {
1405
+ const PATH : & ' static str = "tests/coverage" ;
1364
1406
const SUITE : & ' static str = "coverage" ;
1407
+
1408
+ fn run_unified_suite ( & self , builder : & Builder < ' _ > , mode : & ' static str ) {
1409
+ builder. ensure ( Compiletest {
1410
+ compiler : self . compiler ,
1411
+ target : self . target ,
1412
+ mode,
1413
+ suite : Self :: SUITE ,
1414
+ path : Self :: PATH ,
1415
+ compare_mode : None ,
1416
+ } )
1417
+ }
1365
1418
}
1366
1419
1367
1420
impl Step for Coverage {
0 commit comments