ANDROID: Add kunit installation rules
Use pkg_install to create installation rules for kunit test modules. To
build and install kunit test modules into /tmp/kunit_tests directory run:
$ tools/bazel run -- //common:kunit_tests_x86_64_dist -v \
--destdir /tmp/kunit_tests
Also updated the kunit Android README to use this rule instead of
creating tests.zip and unzipping it.
Bug: 324907235
Change-Id: I1e611cf8cc2836cb213526aa270da6fd422f7352
Signed-off-by: Joe Fradley <joefradley@google.com>
This commit is contained in:
17
BUILD.bazel
17
BUILD.bazel
@@ -4,6 +4,7 @@
|
||||
load("@bazel_skylib//lib:paths.bzl", "paths")
|
||||
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
|
||||
load("@bazel_skylib//rules:write_file.bzl", "write_file")
|
||||
load("@rules_pkg//pkg:install.bzl", "pkg_install")
|
||||
load(
|
||||
"@rules_pkg//pkg:mappings.bzl",
|
||||
"pkg_filegroup",
|
||||
@@ -857,6 +858,13 @@ pkg_filegroup(
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
pkg_install(
|
||||
name = "kunit_tests_arm64_install",
|
||||
srcs = [
|
||||
":kunit_tests_arm64_pkg_files",
|
||||
],
|
||||
)
|
||||
|
||||
pkg_files(
|
||||
name = "kunit_x86_64_stripped",
|
||||
srcs = [":kunit_x86_64"],
|
||||
@@ -884,7 +892,14 @@ pkg_filegroup(
|
||||
":kunit_x86_64_test_config",
|
||||
],
|
||||
prefix = _KUNIT_DIR,
|
||||
#visibility = ["//visibility:private"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
pkg_install(
|
||||
name = "kunit_tests_x86_64_install",
|
||||
srcs = [
|
||||
":kunit_tests_x86_64_pkg_files",
|
||||
],
|
||||
)
|
||||
|
||||
# DDK Headers
|
||||
|
||||
@@ -49,16 +49,13 @@ View test results
|
||||
....
|
||||
|
||||
Run ACK KUnit tests via tradefed
|
||||
* Build ACK KUnit tests:
|
||||
$ tools/bazel build //common:tests_zip_arm64_dist
|
||||
|
||||
* Unzip tests.zip (e.g. in local tmp directory):
|
||||
$ unzip bazel-bin/common/arm64/tests.zip -d tmp
|
||||
* Build ACK KUnit tests and install (e.g. /tmp/kunit_tests):
|
||||
$ tools/bazel run -- //common:kunit_tests_x86_64_install -v --destdir /tmp/kunit_tests
|
||||
|
||||
* With device connected and accessible via adb run the tests:
|
||||
$ prebuilts/tradefed/filegroups/tradefed/tradefed.sh run commandAndExit \
|
||||
template/local_min --template:map test=suite/test_mapping_suite \
|
||||
--include-filter kunit --tests-dir=tmp/testcases --primary-abi-only
|
||||
--include-filter kunit --tests-dir=/tmp/kunit_tests --primary-abi-only
|
||||
....
|
||||
=======================================================
|
||||
=============== Summary ===============
|
||||
|
||||
Reference in New Issue
Block a user