From c072379879d45d005c0fb579bb95750ff71b0234 Mon Sep 17 00:00:00 2001 From: Edward Liaw Date: Thu, 7 Dec 2023 01:54:49 +0000 Subject: [PATCH] ANDROID: kselftests: choose build from the target device's abi Use getprop to retrieve the test device's abi and select the build to run. Bug: 291147200 Change-Id: I79aadbc8a4a4a1bfd3f6c933bdee0e62d1d6d90a Signed-off-by: Edward Liaw --- tools/testing/android/bin/kselftest.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/testing/android/bin/kselftest.sh b/tools/testing/android/bin/kselftest.sh index 152f34e02959..ec05ac962b75 100755 --- a/tools/testing/android/bin/kselftest.sh +++ b/tools/testing/android/bin/kselftest.sh @@ -65,7 +65,19 @@ if $LAUNCH_CVD; then fi echo "Building selftests..." -$BAZEL build //common:kselftest_tests_x86_64 +ABI=$(adb shell getprop ro.product.cpu.abi) +case $ABI in + arm64*) + $BAZEL build //common:kselftest_tests_arm64 + ;; + x86_64*) + $BAZEL build //common:kselftest_tests_x86_64 + ;; + *) + echo "$ABI not supported" + exit 1 + ;; +esac $TRADEFED run commandAndExit template/local_min --template:map test=suite/test_mapping_suite \ --include-filter selftests --tests-dir=$TESTSDIR --primary-abi-only