Skip to content

Commit 3831685

Browse files
Add more asserts to test cases
1 parent 022ce70 commit 3831685

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

src/bootstrap/builder.rs

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,6 +1565,41 @@ mod __test {
15651565
},
15661566
]);
15671567
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+
]);
15681603
}
15691604

15701605
#[test]
@@ -1680,6 +1715,56 @@ mod __test {
16801715
},
16811716
]);
16821717
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+
]);
16831768
}
16841769

16851770
#[test]
@@ -1859,6 +1944,8 @@ mod __test {
18591944

18601945
#[test]
18611946
fn build_with_target_flag() {
1947+
// --build=A --host=B --target=C:
1948+
// ./x.py build --target=C
18621949
let mut config = configure(&["B"], &["C"]);
18631950
config.run_host_only = false;
18641951
let build = Build::new(config);

0 commit comments

Comments
 (0)