ANDROID: Fix kselftest local testing flow.

Now that we no longer rely on copy_file, the directory structure is no
longer maintained below bazel-bin/common. Create a pkg_install rule
that installs the test to the correct place, then start from there.

Bug: 312798837
Test: run kselftest.sh
Change-Id: I4d49d25fe3a2395c184db4b2edea5ae879c30e45
Signed-off-by: HONG Yifan <elsk@google.com>
This commit is contained in:
HONG Yifan
2024-08-02 17:43:02 -07:00
committed by Yifan Hong
parent f552c34dca
commit f929c768a9
2 changed files with 15 additions and 3 deletions
+12
View File
@@ -2267,6 +2267,18 @@ pkg_filegroup(
visibility = ["//visibility:private"],
)
pkg_install(
name = "kselftest_tests_x86_64_install",
srcs = [":kselftest_tests_x86_64_pkg_filegroup"],
visibility = ["//visibility:private"],
)
pkg_install(
name = "kselftest_tests_arm64_install",
srcs = [":kselftest_tests_arm64_pkg_filegroup"],
visibility = ["//visibility:private"],
)
pkg_zip(
name = "tests_zip_x86_64",
srcs = [
+3 -3
View File
@@ -5,7 +5,7 @@ BAZEL=tools/bazel
BIN_DIR=common/tools/testing/android/bin
ACLOUD=$BIN_DIR/acloudb.sh
TRADEFED=prebuilts/tradefed/filegroups/tradefed/tradefed.sh
TESTSDIR=bazel-bin/common/
TESTSDIR=/tmp/kselftests
LOG_DIR=$PWD/out/test_logs/$(date +%Y%m%d_%H%M%S)
JDK_PATH=prebuilts/jdk/jdk11/linux-x86
@@ -165,10 +165,10 @@ ABI=$(adb -s $SERIAL_NUMBER shell getprop ro.product.cpu.abi)
echo "Building kselftests according to device $SERIAL_NUMBER ro.product.cpu.abi $ABI ..."
case $ABI in
arm64*)
$BAZEL build //common:kselftest_tests_arm64
$BAZEL run //common:kselftest_tests_arm64_install -- --destdir $TESTSDIR
;;
x86_64*)
$BAZEL build //common:kselftest_tests_x86_64
$BAZEL run //common:kselftest_tests_x86_64_install -- --destdir $TESTSDIR
;;
*)
echo "$ABI not supported"