Zach Johnson | e1ca1f1 | 2020-04-10 11:56:34 -0700 | [diff] [blame] | 1 | #! /bin/bash |
| 2 | |
| 3 | if [[ -z "${ANDROID_BUILD_TOP}" ]]; then |
| 4 | echo "ANDROID_BUILD_TOP is not set" |
| 5 | fi |
| 6 | |
| 7 | if [[ -z "${ANDROID_HOST_OUT}" ]]; then |
| 8 | echo "ANDROID_HOST_OUT is not set for host run" |
| 9 | fi |
| 10 | |
| 11 | HOST=false |
| 12 | POSITIONAL=() |
| 13 | while [[ $# -gt 0 ]] |
| 14 | do |
| 15 | key="$1" |
| 16 | case $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 | ;; |
| 25 | esac |
| 26 | done |
| 27 | set -- "${POSITIONAL[@]}" # restore positional parameters |
| 28 | |
Zach Johnson | 85f5f7c | 2020-04-20 16:11:21 -0700 | [diff] [blame] | 29 | TEST_NAME=bluetooth_gd_${1}_fuzz_test |
| 30 | |
Zach Johnson | e1ca1f1 | 2020-04-10 11:56:34 -0700 | [diff] [blame] | 31 | if [ "$HOST" == true ] ; then |
| 32 | HOST_ARCH=$($ANDROID_BUILD_TOP/build/soong/soong_ui.bash --dumpvar-mode HOST_ARCH) |
Zach Johnson | 85f5f7c | 2020-04-20 16:11:21 -0700 | [diff] [blame] | 33 | 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 Johnson | e1ca1f1 | 2020-04-10 11:56:34 -0700 | [diff] [blame] | 34 | fi |