1#!/bin/bash -e 2 3. $(dirname $0)/../build/run-on-host.sh 4 5if [ "$1" = glibc ]; then 6 shift 7 m -j bionic-unit-tests-glibc 8 ( 9 cd ${ANDROID_BUILD_TOP} 10 export ANDROID_DATA=${TARGET_OUT_DATA} 11 export ANDROID_ROOT=${TARGET_OUT} 12 ${HOST_OUT}/nativetest64/bionic-unit-tests-glibc/bionic-unit-tests-glibc $@ 13 ) 14 exit 0 15elif [ "$1" != 32 -a "$1" != 64 ]; then 16 echo "Usage: $0 [ 32 | 64 | glibc ] [gtest flags]" 17 exit 1 18fi 19 20if [ ${HOST_OS}-${HOST_ARCH} = linux-x86 -o ${HOST_OS}-${HOST_ARCH} = linux-x86_64 ]; then 21 22 prepare $1 bionic-unit-tests 23 24 if [ ${TARGET_ARCH} = x86 -o ${TARGET_ARCH} = x86_64 ]; then 25 ( 26 cd ${ANDROID_BUILD_TOP} 27 export ANDROID_DATA=${TARGET_OUT_DATA} 28 export ANDROID_DNS_MODE=local 29 export ANDROID_ROOT=${TARGET_OUT} 30 ${NATIVETEST}/bionic-unit-tests/bionic-unit-tests $@ 31 ) 32 else 33 echo "$0 not supported on TARGET_ARCH=$TARGET_ARCH" 34 fi 35fi 36