Skip to content

Commit aa40292

Browse files
committed
Auto merge of #44603 - SimonSapin:stylo, r=alexcrichton
Add Stylo and WebRender to src/tools/cargotest This is a subset of Servo that takes relatively less time to compile and does not use unstable Rust features.
2 parents c2799fc + daf84db commit aa40292

File tree

5 files changed

+62
-5
lines changed

5 files changed

+62
-5
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ matrix:
169169
if: branch = auto
170170
- env: IMAGE=x86_64-gnu-aux
171171
if: branch = auto
172+
- env: IMAGE=x86_64-gnu-cargotest
173+
if: branch = auto
172174
- env: IMAGE=x86_64-gnu-debug
173175
if: branch = auto
174176
- env: IMAGE=x86_64-gnu-nopt

appveyor.yml

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ environment:
2525
RUST_CHECK_TARGET: check-aux
2626
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc
2727

28+
# MSVC cargotest
29+
- MSYS_BITS: 64
30+
SCRIPT: python x.py test src/tools/cargotest
31+
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc
32+
2833
# 32/64-bit MinGW builds.
2934
#
3035
# We are using MinGW with posix threads since LLVM does not compile with

src/bootstrap/mk/Makefile.in

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ check:
5252
$(Q)$(BOOTSTRAP) test $(BOOTSTRAP_ARGS)
5353
check-aux:
5454
$(Q)$(BOOTSTRAP) test \
55-
src/tools/cargotest \
5655
src/tools/cargo \
5756
src/tools/rls \
5857
src/tools/rustfmt \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM ubuntu:16.04
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
g++ \
5+
make \
6+
file \
7+
curl \
8+
ca-certificates \
9+
python2.7 \
10+
git \
11+
cmake \
12+
libssl-dev \
13+
sudo \
14+
xz-utils \
15+
pkg-config \
16+
libgl1-mesa-dev \
17+
llvm-dev \
18+
libfreetype6-dev \
19+
libexpat1-dev
20+
21+
COPY scripts/sccache.sh /scripts/
22+
RUN sh /scripts/sccache.sh
23+
24+
ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu
25+
ENV SCRIPT python2.7 ../x.py test src/tools/cargotest

src/tools/cargotest/main.rs

+30-4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ struct Test {
1919
name: &'static str,
2020
sha: &'static str,
2121
lock: Option<&'static str>,
22+
packages: &'static [&'static str],
2223
}
2324

2425
const TEST_REPOS: &'static [Test] = &[
@@ -27,30 +28,51 @@ const TEST_REPOS: &'static [Test] = &[
2728
repo: "https://github.com/iron/iron",
2829
sha: "21c7dae29c3c214c08533c2a55ac649b418f2fe3",
2930
lock: Some(include_str!("lockfiles/iron-Cargo.lock")),
31+
packages: &[],
3032
},
3133
Test {
3234
name: "ripgrep",
3335
repo: "https://github.com/BurntSushi/ripgrep",
3436
sha: "b65bb37b14655e1a89c7cd19c8b011ef3e312791",
3537
lock: None,
38+
packages: &[],
3639
},
3740
Test {
3841
name: "tokei",
3942
repo: "https://github.com/Aaronepower/tokei",
4043
sha: "5e11c4852fe4aa086b0e4fe5885822fbe57ba928",
4144
lock: None,
45+
packages: &[],
4246
},
4347
Test {
4448
name: "treeify",
4549
repo: "https://github.com/dzamlo/treeify",
4650
sha: "999001b223152441198f117a68fb81f57bc086dd",
4751
lock: None,
52+
packages: &[],
4853
},
4954
Test {
5055
name: "xsv",
5156
repo: "https://github.com/BurntSushi/xsv",
5257
sha: "4b308adbe48ac81657fd124b90b44f7c3263f771",
5358
lock: None,
59+
packages: &[],
60+
},
61+
Test {
62+
name: "servo",
63+
repo: "https://github.com/servo/servo",
64+
sha: "38fe9533b93e985657f99a29772bf3d3c8694822",
65+
lock: None,
66+
// Only test Stylo a.k.a. Quantum CSS, the parts of Servo going into Firefox.
67+
// This takes much less time to build than all of Servo and supports stable Rust.
68+
packages: &["stylo_tests", "selectors"],
69+
},
70+
Test {
71+
name: "webrender",
72+
repo: "https://github.com/servo/webrender",
73+
sha: "57250b2b8fa63934f80e5376a29f7dcb3f759ad6",
74+
lock: None,
75+
packages: &[],
5476
},
5577
];
5678

@@ -74,7 +96,7 @@ fn test_repo(cargo: &Path, out_dir: &Path, test: &Test) {
7496
.write_all(lockfile.as_bytes())
7597
.expect("");
7698
}
77-
if !run_cargo_test(cargo, &dir) {
99+
if !run_cargo_test(cargo, &dir, test.packages) {
78100
panic!("tests failed for {}", test.repo);
79101
}
80102
}
@@ -134,9 +156,13 @@ fn clone_repo(test: &Test, out_dir: &Path) -> PathBuf {
134156
out_dir
135157
}
136158

137-
fn run_cargo_test(cargo_path: &Path, crate_path: &Path) -> bool {
138-
let status = Command::new(cargo_path)
139-
.arg("test")
159+
fn run_cargo_test(cargo_path: &Path, crate_path: &Path, packages: &[&str]) -> bool {
160+
let mut command = Command::new(cargo_path);
161+
command.arg("test");
162+
for name in packages {
163+
command.arg("-p").arg(name);
164+
}
165+
let status = command
140166
// Disable rust-lang/cargo's cross-compile tests
141167
.env("CFG_DISABLE_CROSS_TESTS", "1")
142168
.current_dir(crate_path)

0 commit comments

Comments
 (0)