@@ -1565,6 +1565,41 @@ mod __test {
1565
1565
} ,
1566
1566
] ) ;
1567
1567
assert_eq ! ( first( builder. cache. all:: <dist:: Src >( ) ) , & [ dist:: Src ] ) ;
1568
+
1569
+
1570
+ assert_eq ! ( first( builder. cache. all:: <compile:: Rustc >( ) ) , & [
1571
+ compile:: Rustc {
1572
+ compiler: Compiler { host: a, stage: 0 } ,
1573
+ target: a,
1574
+ } ,
1575
+ compile:: Rustc { // FIXME: this is not needed
1576
+ compiler: Compiler { host: a, stage: 1 } ,
1577
+ target: a,
1578
+ } ,
1579
+ compile:: Rustc { // FIXME: this is not needed
1580
+ compiler: Compiler { host: a, stage: 2 } ,
1581
+ target: a,
1582
+ } ,
1583
+ ] ) ;
1584
+
1585
+ assert_eq ! ( first( builder. cache. all:: <compile:: Test >( ) ) , & [
1586
+ compile:: Test {
1587
+ compiler: Compiler { host: a, stage: 0 } ,
1588
+ target: a,
1589
+ } ,
1590
+ compile:: Test {
1591
+ compiler: Compiler { host: a, stage: 1 } ,
1592
+ target: a,
1593
+ } ,
1594
+ compile:: Test {
1595
+ compiler: Compiler { host: a, stage: 2 } ,
1596
+ target: a,
1597
+ } ,
1598
+ compile:: Test {
1599
+ compiler: Compiler { host: a, stage: 2 } ,
1600
+ target: b,
1601
+ } ,
1602
+ ] ) ;
1568
1603
}
1569
1604
1570
1605
#[ test]
@@ -1680,6 +1715,56 @@ mod __test {
1680
1715
} ,
1681
1716
] ) ;
1682
1717
assert_eq ! ( first( builder. cache. all:: <dist:: Src >( ) ) , & [ ] ) ;
1718
+
1719
+ assert_eq ! ( first( builder. cache. all:: <compile:: Rustc >( ) ) , & [
1720
+ compile:: Rustc {
1721
+ compiler: Compiler { host: a, stage: 0 } ,
1722
+ target: a,
1723
+ } ,
1724
+ compile:: Rustc {
1725
+ compiler: Compiler { host: a, stage: 1 } ,
1726
+ target: a,
1727
+ } ,
1728
+ compile:: Rustc {
1729
+ compiler: Compiler { host: a, stage: 1 } ,
1730
+ target: b,
1731
+ } ,
1732
+ compile:: Rustc {
1733
+ compiler: Compiler { host: a, stage: 2 } ,
1734
+ target: a,
1735
+ } ,
1736
+ compile:: Rustc {
1737
+ compiler: Compiler { host: a, stage: 2 } ,
1738
+ target: b,
1739
+ } ,
1740
+ ] ) ;
1741
+
1742
+ assert_eq ! ( first( builder. cache. all:: <compile:: Test >( ) ) , & [
1743
+ compile:: Test {
1744
+ compiler: Compiler { host: a, stage: 0 } ,
1745
+ target: a,
1746
+ } ,
1747
+ compile:: Test {
1748
+ compiler: Compiler { host: a, stage: 1 } ,
1749
+ target: a,
1750
+ } ,
1751
+ compile:: Test {
1752
+ compiler: Compiler { host: a, stage: 2 } ,
1753
+ target: a,
1754
+ } ,
1755
+ compile:: Test {
1756
+ compiler: Compiler { host: a, stage: 1 } ,
1757
+ target: b,
1758
+ } ,
1759
+ compile:: Test {
1760
+ compiler: Compiler { host: a, stage: 2 } ,
1761
+ target: b,
1762
+ } ,
1763
+ compile:: Test {
1764
+ compiler: Compiler { host: a, stage: 2 } ,
1765
+ target: c,
1766
+ } ,
1767
+ ] ) ;
1683
1768
}
1684
1769
1685
1770
#[ test]
@@ -1859,6 +1944,8 @@ mod __test {
1859
1944
1860
1945
#[ test]
1861
1946
fn build_with_target_flag ( ) {
1947
+ // --build=A --host=B --target=C:
1948
+ // ./x.py build --target=C
1862
1949
let mut config = configure ( & [ "B" ] , & [ "C" ] ) ;
1863
1950
config. run_host_only = false ;
1864
1951
let build = Build :: new ( config) ;
0 commit comments