2016-07-12 01:20:06 +02:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
. $(dirname $0)/../build/run-on-host.sh
|
|
|
|
|
2023-07-19 20:37:43 +02:00
|
|
|
if [ "$1" = glibc -o "$1" = musl ]; then
|
|
|
|
if [ "$1" = musl ]; then
|
|
|
|
BUILD_ARGS=USE_HOST_MUSL=true
|
|
|
|
else
|
|
|
|
BUILD_ARGS=
|
|
|
|
fi
|
2019-03-26 22:47:08 +01:00
|
|
|
shift
|
2023-07-19 20:37:43 +02:00
|
|
|
m -j $BUILD_ARGS bionic-unit-tests-glibc
|
2019-03-26 22:47:08 +01:00
|
|
|
(
|
|
|
|
cd ${ANDROID_BUILD_TOP}
|
|
|
|
export ANDROID_DATA=${TARGET_OUT_DATA}
|
|
|
|
export ANDROID_ROOT=${TARGET_OUT}
|
|
|
|
${HOST_OUT}/nativetest64/bionic-unit-tests-glibc/bionic-unit-tests-glibc $@
|
|
|
|
)
|
|
|
|
exit 0
|
2016-07-12 01:20:06 +02:00
|
|
|
elif [ "$1" != 32 -a "$1" != 64 ]; then
|
2023-07-19 20:37:43 +02:00
|
|
|
echo "Usage: $0 [ 32 | 64 | glibc | musl ] [gtest flags]"
|
2019-03-26 22:47:08 +01:00
|
|
|
exit 1
|
2016-07-12 01:20:06 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ${HOST_OS}-${HOST_ARCH} = linux-x86 -o ${HOST_OS}-${HOST_ARCH} = linux-x86_64 ]; then
|
|
|
|
|
2019-03-26 22:47:08 +01:00
|
|
|
prepare $1 bionic-unit-tests
|
2019-04-27 00:12:57 +02:00
|
|
|
shift
|
2016-07-12 01:20:06 +02:00
|
|
|
|
2019-03-26 22:47:08 +01:00
|
|
|
if [ ${TARGET_ARCH} = x86 -o ${TARGET_ARCH} = x86_64 ]; then
|
|
|
|
(
|
|
|
|
cd ${ANDROID_BUILD_TOP}
|
|
|
|
export ANDROID_DATA=${TARGET_OUT_DATA}
|
|
|
|
export ANDROID_DNS_MODE=local
|
|
|
|
export ANDROID_ROOT=${TARGET_OUT}
|
|
|
|
${NATIVETEST}/bionic-unit-tests/bionic-unit-tests $@
|
|
|
|
)
|
|
|
|
else
|
|
|
|
echo "$0 not supported on TARGET_ARCH=$TARGET_ARCH"
|
|
|
|
fi
|
2016-07-12 01:20:06 +02:00
|
|
|
fi
|