2016-06-10 14:03:23 +02:00
|
|
|
# Small script to run tests for a target (or all targets) inside all the
|
|
|
|
# respective docker images.
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
run() {
|
|
|
|
echo $1
|
2017-02-23 20:08:29 +01:00
|
|
|
# use -f so we can use ci/ as build context
|
|
|
|
docker build -t libc -f ci/docker/$1/Dockerfile ci/
|
2016-11-16 23:12:12 +01:00
|
|
|
mkdir -p target
|
2017-04-19 15:59:04 +02:00
|
|
|
if [ -w /dev/kvm ]; then
|
|
|
|
kvm="--volume /dev/kvm:/dev/kvm"
|
|
|
|
fi
|
2016-06-10 14:03:23 +02:00
|
|
|
docker run \
|
2016-11-16 23:12:12 +01:00
|
|
|
--user `id -u`:`id -g` \
|
2016-10-08 20:33:09 +02:00
|
|
|
--rm \
|
2017-08-22 07:48:18 +02:00
|
|
|
--init \
|
2016-11-16 23:12:12 +01:00
|
|
|
--volume $HOME/.cargo:/cargo \
|
2017-04-19 15:59:04 +02:00
|
|
|
$kvm \
|
2016-11-16 23:12:12 +01:00
|
|
|
--env CARGO_HOME=/cargo \
|
|
|
|
--volume `rustc --print sysroot`:/rust:ro \
|
|
|
|
--volume `pwd`:/checkout:ro \
|
|
|
|
--volume `pwd`/target:/checkout/target \
|
|
|
|
--env CARGO_TARGET_DIR=/checkout/target \
|
|
|
|
--workdir /checkout \
|
|
|
|
libc \
|
2016-06-10 14:03:23 +02:00
|
|
|
ci/run.sh $1
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
for d in `ls ci/docker/`; do
|
|
|
|
run $d
|
|
|
|
done
|
|
|
|
else
|
|
|
|
run $1
|
|
|
|
fi
|