blob: add645c7929748bf23d376e89e736b7440cb3bb7 [file] [log] [blame]
Zach Johnsone1ca1f12020-04-10 11:56:34 -07001#! /bin/bash
2
3if [[ -z "${ANDROID_BUILD_TOP}" ]]; then
4 echo "ANDROID_BUILD_TOP is not set"
5fi
6
7if [[ -z "${ANDROID_HOST_OUT}" ]]; then
8 echo "ANDROID_HOST_OUT is not set for host run"
9fi
10
11HOST=false
12POSITIONAL=()
13while [[ $# -gt 0 ]]
14do
15key="$1"
16case $key in
17 --host)
18 HOST=true
19 shift # past argument
20 ;;
21 *) # unknown option
22 POSITIONAL+=("$1") # save it in an array for later
23 shift # past argument
24 ;;
25esac
26done
27set -- "${POSITIONAL[@]}" # restore positional parameters
28
Zach Johnson85f5f7c2020-04-20 16:11:21 -070029TEST_NAME=bluetooth_gd_${1}_fuzz_test
30
Zach Johnsone1ca1f12020-04-10 11:56:34 -070031if [ "$HOST" == true ] ; then
32 HOST_ARCH=$($ANDROID_BUILD_TOP/build/soong/soong_ui.bash --dumpvar-mode HOST_ARCH)
Zach Johnson85f5f7c2020-04-20 16:11:21 -070033 SANITIZE_HOST=address $ANDROID_BUILD_TOP/build/soong/soong_ui.bash --build-mode --"all-modules" --dir="$(pwd)" $TEST_NAME && ${ANDROID_HOST_OUT}/fuzz/$HOST_ARCH/$TEST_NAME/$TEST_NAME $2
Zach Johnsone1ca1f12020-04-10 11:56:34 -070034fi