Skip to content

Commit b174920

Browse files
committed
Rollup merge of rust-lang#39120 - alexcrichton:emscripten-tests, r=brson
travis: Get an emscripten builder online This commit adds a new entry to the Travis matrix which will execute emscripten test suites. Along the way it updates a few bits of the test suite to continue passing on emscripten, such as: * Ignoring i128/u128 tests as they're presumably just not working (didn't investigate as to why) * Disabling a few process tests (not working on emscripten) * Ignore some num tests in libstd (rust-lang#39119) * Fix some warnings when compiling
2 parents 17294d9 + e8f9d2d commit b174920

25 files changed

+92
-2
lines changed

src/bootstrap/sanity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn check(build: &mut Build) {
4545
let target = path.join(cmd);
4646
let mut cmd_alt = cmd.to_os_string();
4747
cmd_alt.push(".exe");
48-
if target.exists() ||
48+
if target.is_file() ||
4949
target.with_extension("exe").exists() ||
5050
target.join(cmd_alt).exists() {
5151
return Some(target);

src/ci/docker/emscripten/Dockerfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
python \
10+
git \
11+
cmake \
12+
sudo \
13+
gdb \
14+
xz-utils \
15+
lib32stdc++6
16+
17+
ENV SCCACHE_DIGEST=7237e38e029342fa27b7ac25412cb9d52554008b12389727320bd533fd7f05b6a96d55485f305caf95e5c8f5f97c3313e10012ccad3e752aba2518f3522ba783
18+
RUN curl -L https://api.pub.build.mozilla.org/tooltool/sha512/$SCCACHE_DIGEST | \
19+
tar xJf - -C /usr/local/bin --strip-components=1
20+
21+
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
22+
dpkg -i dumb-init_*.deb && \
23+
rm dumb-init_*.deb
24+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
25+
26+
WORKDIR /tmp
27+
COPY build-emscripten.sh /tmp/
28+
RUN ./build-emscripten.sh
29+
ENV PATH=$PATH:/tmp/emsdk_portable
30+
ENV PATH=$PATH:/tmp/emsdk_portable/clang/tag-e1.37.1/build_tag-e1.37.1_32/bin
31+
ENV PATH=$PATH:/tmp/emsdk_portable/node/4.1.1_32bit/bin
32+
ENV PATH=$PATH:/tmp/emsdk_portable/emscripten/tag-1.37.1
33+
ENV EMSCRIPTEN=/tmp/emsdk_portable/emscripten/tag-1.37.1
34+
35+
ENV RUST_CONFIGURE_ARGS --target=asmjs-unknown-emscripten
36+
37+
# Run `emcc` first as it's got a prompt and doesn't actually do anything, after
38+
# that's done with do the real build.
39+
ENV SCRIPT emcc && \
40+
python2.7 ../x.py test --target asmjs-unknown-emscripten
41+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
3+
# file at the top-level directory of this distribution and at
4+
# http://rust-lang.org/COPYRIGHT.
5+
#
6+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9+
# option. This file may not be copied, modified, or distributed
10+
# except according to those terms.
11+
12+
set -ex
13+
14+
curl https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | \
15+
tar xzf -
16+
source emsdk_portable/emsdk_env.sh
17+
emsdk update
18+
emsdk install --build=Release sdk-tag-1.37.1-32bit
19+
emsdk activate --build=Release sdk-tag-1.37.1-32bit

src/libstd/net/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[allow(dead_code)] // not used on emscripten
11+
#![allow(warnings)] // not used on emscripten
1212

1313
use env;
1414
use net::{SocketAddr, SocketAddrV4, SocketAddrV6, Ipv4Addr, Ipv6Addr, ToSocketAddrs};

src/libstd/num.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ mod tests {
172172

173173
macro_rules! test_checked_next_power_of_two {
174174
($test_name:ident, $T:ident) => (
175+
#[cfg_attr(target_os = "emscripten", ignore)] // FIXME(#39119)
175176
fn $test_name() {
176177
#![test]
177178
assert_eq!((0 as $T).checked_next_power_of_two(), Some(1));

src/test/codegen/fastcall-inreg.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
// ignore-shave
5454
// ignore-wasm32
5555
// ignore-wasm64
56+
// ignore-emscripten
5657

5758
// compile-flags: -C no-prepopulate-passes
5859

src/test/compile-fail/asm-bad-clobber.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// ignore-arm
1313
// ignore-aarch64
1414
// ignore-s390x
15+
// ignore-emscripten
1516

1617
#![feature(asm, rustc_attrs)]
1718

src/test/compile-fail/asm-in-bad-modifier.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// ignore-s390x
12+
// ignore-emscripten
1213

1314
#![feature(asm)]
1415

src/test/compile-fail/asm-misplaced-option.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// ignore-arm
1313
// ignore-aarch64
1414
// ignore-s390x
15+
// ignore-emscripten
1516

1617
#![feature(asm, rustc_attrs)]
1718

src/test/compile-fail/asm-out-assign-imm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// ignore-s390x
12+
// ignore-emscripten
1213

1314
#![feature(asm)]
1415

0 commit comments

Comments
 (0)