about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-10-24 23:30:15 +0000
committerbors <bors@rust-lang.org>2017-10-24 23:30:15 +0000
commitaa40292e78251f8027de72726dc4dc5ef2f1037f (patch)
tree668872cf438d8acf0afd6e41cac75ff0befae1de
parentc2799fc9a5c631a790744ceb9cd08259af338c0c (diff)
parentdaf84db4d26346d1555ce1252321e23d2aceb223 (diff)
downloadrust-aa40292e78251f8027de72726dc4dc5ef2f1037f.tar.gz
rust-aa40292e78251f8027de72726dc4dc5ef2f1037f.zip
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.
-rw-r--r--.travis.yml2
-rw-r--r--appveyor.yml5
-rw-r--r--src/bootstrap/mk/Makefile.in1
-rw-r--r--src/ci/docker/x86_64-gnu-cargotest/Dockerfile25
-rw-r--r--src/tools/cargotest/main.rs34
5 files changed, 62 insertions, 5 deletions
diff --git a/.travis.yml b/.travis.yml
index c76e17a27d1..db34f140448 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -169,6 +169,8 @@ matrix:
       if: branch = auto
     - env: IMAGE=x86_64-gnu-aux
       if: branch = auto
+    - env: IMAGE=x86_64-gnu-cargotest
+      if: branch = auto
     - env: IMAGE=x86_64-gnu-debug
       if: branch = auto
     - env: IMAGE=x86_64-gnu-nopt
diff --git a/appveyor.yml b/appveyor.yml
index 599d1b40ceb..b86fa25337b 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -25,6 +25,11 @@ environment:
     RUST_CHECK_TARGET: check-aux
     RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc
 
+  # MSVC cargotest
+  - MSYS_BITS: 64
+    SCRIPT: python x.py test src/tools/cargotest
+    RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc
+
   # 32/64-bit MinGW builds.
   #
   # We are using MinGW with posix threads since LLVM does not compile with
diff --git a/src/bootstrap/mk/Makefile.in b/src/bootstrap/mk/Makefile.in
index 004f0c31024..eb92c8f143b 100644
--- a/src/bootstrap/mk/Makefile.in
+++ b/src/bootstrap/mk/Makefile.in
@@ -52,7 +52,6 @@ check:
 	$(Q)$(BOOTSTRAP) test $(BOOTSTRAP_ARGS)
 check-aux:
 	$(Q)$(BOOTSTRAP) test \
-		src/tools/cargotest \
 		src/tools/cargo \
 		src/tools/rls \
 		src/tools/rustfmt \
diff --git a/src/ci/docker/x86_64-gnu-cargotest/Dockerfile b/src/ci/docker/x86_64-gnu-cargotest/Dockerfile
new file mode 100644
index 00000000000..a5326625bf4
--- /dev/null
+++ b/src/ci/docker/x86_64-gnu-cargotest/Dockerfile
@@ -0,0 +1,25 @@
+FROM ubuntu:16.04
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+  g++ \
+  make \
+  file \
+  curl \
+  ca-certificates \
+  python2.7 \
+  git \
+  cmake \
+  libssl-dev \
+  sudo \
+  xz-utils \
+  pkg-config \
+  libgl1-mesa-dev \
+  llvm-dev \
+  libfreetype6-dev \
+  libexpat1-dev
+
+COPY scripts/sccache.sh /scripts/
+RUN sh /scripts/sccache.sh
+
+ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu
+ENV SCRIPT python2.7 ../x.py test src/tools/cargotest
diff --git a/src/tools/cargotest/main.rs b/src/tools/cargotest/main.rs
index 0a9da26d996..00276ee34d4 100644
--- a/src/tools/cargotest/main.rs
+++ b/src/tools/cargotest/main.rs
@@ -19,6 +19,7 @@ struct Test {
     name: &'static str,
     sha: &'static str,
     lock: Option<&'static str>,
+    packages: &'static [&'static str],
 }
 
 const TEST_REPOS: &'static [Test] = &[
@@ -27,30 +28,51 @@ const TEST_REPOS: &'static [Test] = &[
         repo: "https://github.com/iron/iron",
         sha: "21c7dae29c3c214c08533c2a55ac649b418f2fe3",
         lock: Some(include_str!("lockfiles/iron-Cargo.lock")),
+        packages: &[],
     },
     Test {
         name: "ripgrep",
         repo: "https://github.com/BurntSushi/ripgrep",
         sha: "b65bb37b14655e1a89c7cd19c8b011ef3e312791",
         lock: None,
+        packages: &[],
     },
     Test {
         name: "tokei",
         repo: "https://github.com/Aaronepower/tokei",
         sha: "5e11c4852fe4aa086b0e4fe5885822fbe57ba928",
         lock: None,
+        packages: &[],
     },
     Test {
         name: "treeify",
         repo: "https://github.com/dzamlo/treeify",
         sha: "999001b223152441198f117a68fb81f57bc086dd",
         lock: None,
+        packages: &[],
     },
     Test {
         name: "xsv",
         repo: "https://github.com/BurntSushi/xsv",
         sha: "4b308adbe48ac81657fd124b90b44f7c3263f771",
         lock: None,
+        packages: &[],
+    },
+    Test {
+        name: "servo",
+        repo: "https://github.com/servo/servo",
+        sha: "38fe9533b93e985657f99a29772bf3d3c8694822",
+        lock: None,
+        // Only test Stylo a.k.a. Quantum CSS, the parts of Servo going into Firefox.
+        // This takes much less time to build than all of Servo and supports stable Rust.
+        packages: &["stylo_tests", "selectors"],
+    },
+    Test {
+        name: "webrender",
+        repo: "https://github.com/servo/webrender",
+        sha: "57250b2b8fa63934f80e5376a29f7dcb3f759ad6",
+        lock: None,
+        packages: &[],
     },
 ];
 
@@ -74,7 +96,7 @@ fn test_repo(cargo: &Path, out_dir: &Path, test: &Test) {
             .write_all(lockfile.as_bytes())
             .expect("");
     }
-    if !run_cargo_test(cargo, &dir) {
+    if !run_cargo_test(cargo, &dir, test.packages) {
         panic!("tests failed for {}", test.repo);
     }
 }
@@ -134,9 +156,13 @@ fn clone_repo(test: &Test, out_dir: &Path) -> PathBuf {
     out_dir
 }
 
-fn run_cargo_test(cargo_path: &Path, crate_path: &Path) -> bool {
-    let status = Command::new(cargo_path)
-        .arg("test")
+fn run_cargo_test(cargo_path: &Path, crate_path: &Path, packages: &[&str]) -> bool {
+    let mut command = Command::new(cargo_path);
+    command.arg("test");
+    for name in packages {
+        command.arg("-p").arg(name);
+    }
+    let status = command
         // Disable rust-lang/cargo's cross-compile tests
         .env("CFG_DISABLE_CROSS_TESTS", "1")
         .current_dir(crate_path)