blob: c8a30f543c9b890f8c763893a9c4e32e72657d9e [file] [log] [blame]
Colin Cross2722ebb2016-07-11 16:20:06 -07001#!/bin/bash -e
2
3. $(dirname $0)/../build/run-on-host.sh
4
5if [ "$1" = glibc ]; then
Elliott Hughes8ceb95c2019-03-26 14:47:08 -07006 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
Colin Cross2722ebb2016-07-11 16:20:06 -070015elif [ "$1" != 32 -a "$1" != 64 ]; then
Elliott Hughes8ceb95c2019-03-26 14:47:08 -070016 echo "Usage: $0 [ 32 | 64 | glibc ] [gtest flags]"
17 exit 1
Colin Cross2722ebb2016-07-11 16:20:06 -070018fi
19
20if [ ${HOST_OS}-${HOST_ARCH} = linux-x86 -o ${HOST_OS}-${HOST_ARCH} = linux-x86_64 ]; then
21
Elliott Hughes8ceb95c2019-03-26 14:47:08 -070022 prepare $1 bionic-unit-tests
Colin Cross2722ebb2016-07-11 16:20:06 -070023
Elliott Hughes8ceb95c2019-03-26 14:47:08 -070024 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
Colin Cross2722ebb2016-07-11 16:20:06 -070035fi