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 shift 24 25 if [ ${TARGET_ARCH} = x86 -o ${TARGET_ARCH} = x86_64 ]; then 26 ( 27 cd ${ANDROID_BUILD_TOP} 28 export ANDROID_DATA=${TARGET_OUT_DATA} 29 export ANDROID_DNS_MODE=local 30 export ANDROID_ROOT=${TARGET_OUT} 31 ${NATIVETEST}/bionic-unit-tests/bionic-unit-tests $@ 32 ) 33 else 34 echo "$0 not supported on TARGET_ARCH=$TARGET_ARCH" 35 fi 36fi 37