Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / utils / ci / vendor / android / run-buildbot-container
blob4ab83194c05d5c41a6fa26ec1fd0515091252833
1 #!/usr/bin/env bash
3 # Similar to libcxx/utils/ci/run-buildbot-container, but adds additional options
4 # needed for running Android tests.
6 set -e
8 MONOREPO_ROOT="$(git rev-parse --show-toplevel)"
9 if [[ ! -d "${MONOREPO_ROOT}/libcxx/utils/ci/vendor/android" ]]; then
10 echo "Was unable to find the root of the LLVM monorepo; are you running from within the monorepo?"
11 exit 1
14 DOCKER_OPTIONS=(-it)
15 DOCKER_OPTIONS+=(--volume "${MONOREPO_ROOT}:/llvm")
16 DOCKER_OPTIONS+=(--workdir "/llvm")
17 DOCKER_OPTIONS+=(--cap-add=SYS_PTRACE)
19 # Mount this volume to allow the main image to share its copy of the Android
20 # platform tools with the emulator image, ensuring that the adb versions match.
21 # This argument will create a new volume if it doesn't already exist.
22 DOCKER_OPTIONS+=(--volume android-platform-tools:/mnt/android-platform-tools)
24 # Pass through the Docker socket so that the buildbot can start a sibling
25 # container running an Android emulator.
26 if [ -S /var/run/docker.sock ]; then
27 DOCKER_OPTIONS+=(--volume /var/run/docker.sock:/var/run/docker.sock)
30 docker run "${DOCKER_OPTIONS[@]}" libcxx-builder-android \
31 bash -c 'git config --global --add safe.directory /llvm; (/opt/android/container-setup.sh && exec bash)'