File tree 2 files changed +19
-14
lines changed 2 files changed +19
-14
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
1
3
# Small script to run tests for a target (or all targets) inside all the
2
4
# respective docker images.
3
5
4
- set -ex
6
+ set -euxo pipefail
5
7
6
8
run () {
7
9
local target=$1
8
10
9
- echo $target
11
+ echo " testing target: $target "
10
12
11
13
# This directory needs to exist before calling docker, otherwise docker will create it but it
12
14
# will be owned by root
13
15
mkdir -p target
14
16
15
- docker build -t $target ci/docker/$target
17
+ docker build -t " $target " " ci/docker/$target "
16
18
docker run \
17
19
--rm \
18
- --user $( id -u) :$( id -g) \
20
+ --user " $( id -u) :$( id -g) " \
19
21
-e RUSTFLAGS \
20
22
-e CARGO_HOME=/cargo \
21
23
-e CARGO_TARGET_DIR=/target \
22
- -v " ${HOME} /.cargo" :/cargo \
23
- -v ` pwd` /target:/target \
24
- -v ` pwd` :/checkout:ro \
25
- -v ` rustc --print sysroot` :/rust:ro \
24
+ -v " ${HOME} /.cargo:/cargo" \
25
+ -v " $( pwd) /target:/target" \
26
+ -v " $( pwd) :/checkout:ro" \
27
+ -v " $( rustc --print sysroot) :/rust:ro" \
26
28
--init \
27
29
-w /checkout \
28
- $target \
30
+ " $target " \
29
31
sh -c " HOME=/tmp PATH=\$ PATH:/rust/bin exec ci/run.sh $target "
30
32
}
31
33
32
34
if [ -z " $1 " ]; then
33
- for d in ` ls ci/docker/` ; do
35
+ echo " running tests for all targets"
36
+
37
+ for d in ci/docker/* ; do
34
38
run $d
35
39
done
36
40
else
Original file line number Diff line number Diff line change 1
- #! /usr/ bin/env sh
1
+ #! /bin/sh
2
2
3
- set -ex
4
- TARGET=$1
3
+ set -eux
5
4
6
- cmd=" cargo test --all --target $TARGET "
5
+ target=" $1 "
6
+
7
+ cmd=" cargo test --all --target $target "
7
8
8
9
# Needed for no-panic to correct detect a lack of panics
9
10
export RUSTFLAGS=" $RUSTFLAGS -Ccodegen-units=1"
You can’t perform that action at this time.
0 commit comments