OSDN Git Service

Run by default the 64-bit unit tests on 64-bit devices
authorPavlin Radoslavov <pavlin@google.com>
Tue, 9 Jan 2018 13:58:53 +0000 (05:58 -0800)
committerPavlin Radoslavov <pavlin@google.com>
Tue, 9 Jan 2018 13:58:53 +0000 (05:58 -0800)
Bug: 71739588
Test: cd system/bt; mm -j 40; test/run_unit_tests.sh
Change-Id: Ie4206a8935456a0b62b7a4b90c7247f398a6a7ef

test/run_unit_tests.sh

index 8fe47f8..4c390bf 100755 (executable)
@@ -102,11 +102,18 @@ if [ -n "${device}" ]; then
   adb+=( "-s" "${device}" )
 fi
 
+source ${ANDROID_BUILD_TOP}/build/envsetup.sh
+target_arch=$(gettargetarch)
+
 failed_tests=()
 for spec in "${tests[@]}"
 do
   name="${spec%%.*}"
-  binary="/data/nativetest/${name}/${name}"
+  if [[ $target_arch == *"64"* ]]; then
+    binary="/data/nativetest64/${name}/${name}"
+  else
+    binary="/data/nativetest/${name}/${name}"
+  fi
 
   push_command=( "${adb[@]}" push {"${ANDROID_PRODUCT_OUT}",}"${binary}" )
   test_command=( "${adb[@]}" shell "${binary}" )