aboutsummaryrefslogtreecommitdiff
path: root/tests/run-on-host.sh
blob: fe2c25a3014d1fbe36e63c891fac61b0b3c0c575 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash -e

. $(dirname $0)/../build/run-on-host.sh

if [ "$1" = glibc ]; then
  shift
  m -j bionic-unit-tests-glibc
  (
    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
elif [ "$1" != 32 -a "$1" != 64 ]; then
  echo "Usage: $0 [ 32 | 64 | glibc ] [gtest flags]"
  exit 1
fi

if [ ${HOST_OS}-${HOST_ARCH} = linux-x86 -o ${HOST_OS}-${HOST_ARCH} = linux-x86_64 ]; then

  prepare $1 bionic-unit-tests
  shift

  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
fi