xref: /rust-libc-0.2.174/ci/run-docker.sh (revision d862a369)
1# Small script to run tests for a target (or all targets) inside all the
2# respective docker images.
3
4set -ex
5
6run() {
7    echo $1
8    docker build -t libc ci/docker/$1
9    mkdir -p target
10    docker run \
11      --user `id -u`:`id -g` \
12      --rm \
13      --volume $HOME/.cargo:/cargo \
14      --env CARGO_HOME=/cargo \
15      --volume `rustc --print sysroot`:/rust:ro \
16      --volume `pwd`:/checkout:ro \
17      --volume `pwd`/target:/checkout/target \
18      --env CARGO_TARGET_DIR=/checkout/target \
19      --workdir /checkout \
20      --privileged \
21      --interactive \
22      --tty \
23      libc \
24      ci/run.sh $1
25}
26
27if [ -z "$1" ]; then
28  for d in `ls ci/docker/`; do
29    run $d
30  done
31else
32  run $1
33fi
34