1#!/bin/bash -e
2
3readonly UNAME="$(uname)"
4case "$UNAME" in
5Linux)
6    readonly OS='linux'
7    ;;
8Darwin)
9    readonly OS='darwin'
10    ;;
11*)
12    echo "Unsupported OS '$UNAME'"
13    exit 1
14    ;;
15esac
16
17readonly ANDROID_TOP="$(cd $(dirname $0)/../../..; pwd)"
18cd "$ANDROID_TOP"
19
20export OUT_DIR="${OUT_DIR:-out}"
21
22build/soong/soong_ui.bash --make-mode "${OUT_DIR}/host/${OS}-x86/bin/cuj_tests"
23
24"${OUT_DIR}/host/${OS}-x86/bin/cuj_tests" || true
25
26if [ -n "${DIST_DIR}" ]; then
27  cp -r "${OUT_DIR}/cuj_tests/logs" "${DIST_DIR}"
28fi
29