run-docker.sh 589 B

1234567891011121314151617181920212223242526272829
  1. # Small script to run tests for a target (or all targets) inside all the
  2. # respective docker images.
  3. set -ex
  4. run() {
  5. echo $1
  6. CMD="cargo test --target $1"
  7. if [ "$NO_RUN" = "1" ]; then
  8. CMD="$CMD --no-run"
  9. fi
  10. docker build -t libc ci/docker/$1
  11. docker run \
  12. -v `rustc --print sysroot`:/rust:ro \
  13. -v `pwd`:/checkout:ro \
  14. -e CARGO_TARGET_DIR=/tmp/target \
  15. -w /checkout \
  16. --privileged \
  17. -it libc \
  18. bash -c "$CMD && $CMD --release"
  19. }
  20. if [ -z "$1" ]; then
  21. for d in `ls ci/docker/`; do
  22. run $d
  23. done
  24. else
  25. run $1
  26. fi