@@ -47,6 +47,16 @@ pub enum TestKind {
47
47
Bench ,
48
48
}
49
49
50
+ impl From < Kind > for TestKind {
51
+ fn from ( kind : Kind ) -> Self {
52
+ match kind {
53
+ Kind :: Test => TestKind :: Test ,
54
+ Kind :: Bench => TestKind :: Bench ,
55
+ _ => panic ! ( "unexpected kind in crate: {:?}" , kind)
56
+ }
57
+ }
58
+ }
59
+
50
60
impl TestKind {
51
61
// Return the cargo subcommand for this test kind
52
62
fn subcommand ( self ) -> & ' static str {
@@ -951,6 +961,10 @@ impl Step for Compiletest {
951
961
cmd. arg ( "--host" ) . arg ( & * compiler. host ) ;
952
962
cmd. arg ( "--llvm-filecheck" ) . arg ( builder. llvm_filecheck ( builder. config . build ) ) ;
953
963
964
+ if builder. config . cmd . bless ( ) {
965
+ cmd. arg ( "--bless" ) ;
966
+ }
967
+
954
968
if let Some ( ref nodejs) = builder. config . nodejs {
955
969
cmd. arg ( "--nodejs" ) . arg ( nodejs) ;
956
970
}
@@ -1342,13 +1356,7 @@ impl Step for CrateLibrustc {
1342
1356
1343
1357
for krate in builder. in_tree_crates ( "rustc-main" ) {
1344
1358
if run. path . ends_with ( & krate. path ) {
1345
- let test_kind = if builder. kind == Kind :: Test {
1346
- TestKind :: Test
1347
- } else if builder. kind == Kind :: Bench {
1348
- TestKind :: Bench
1349
- } else {
1350
- panic ! ( "unexpected builder.kind in crate: {:?}" , builder. kind) ;
1351
- } ;
1359
+ let test_kind = builder. kind . into ( ) ;
1352
1360
1353
1361
builder. ensure ( CrateLibrustc {
1354
1362
compiler,
@@ -1394,13 +1402,7 @@ impl Step for CrateNotDefault {
1394
1402
let builder = run. builder ;
1395
1403
let compiler = builder. compiler ( builder. top_stage , run. host ) ;
1396
1404
1397
- let test_kind = if builder. kind == Kind :: Test {
1398
- TestKind :: Test
1399
- } else if builder. kind == Kind :: Bench {
1400
- TestKind :: Bench
1401
- } else {
1402
- panic ! ( "unexpected builder.kind in crate: {:?}" , builder. kind) ;
1403
- } ;
1405
+ let test_kind = builder. kind . into ( ) ;
1404
1406
1405
1407
builder. ensure ( CrateNotDefault {
1406
1408
compiler,
@@ -1461,13 +1463,7 @@ impl Step for Crate {
1461
1463
let compiler = builder. compiler ( builder. top_stage , run. host ) ;
1462
1464
1463
1465
let make = |mode : Mode , krate : & CargoCrate | {
1464
- let test_kind = if builder. kind == Kind :: Test {
1465
- TestKind :: Test
1466
- } else if builder. kind == Kind :: Bench {
1467
- TestKind :: Bench
1468
- } else {
1469
- panic ! ( "unexpected builder.kind in crate: {:?}" , builder. kind) ;
1470
- } ;
1466
+ let test_kind = builder. kind . into ( ) ;
1471
1467
1472
1468
builder. ensure ( Crate {
1473
1469
compiler,
@@ -1625,13 +1621,7 @@ impl Step for CrateRustdoc {
1625
1621
fn make_run ( run : RunConfig ) {
1626
1622
let builder = run. builder ;
1627
1623
1628
- let test_kind = if builder. kind == Kind :: Test {
1629
- TestKind :: Test
1630
- } else if builder. kind == Kind :: Bench {
1631
- TestKind :: Bench
1632
- } else {
1633
- panic ! ( "unexpected builder.kind in crate: {:?}" , builder. kind) ;
1634
- } ;
1624
+ let test_kind = builder. kind . into ( ) ;
1635
1625
1636
1626
builder. ensure ( CrateRustdoc {
1637
1627
host : run. host ,
0 commit comments