From 2d913d2e4e677a04139166074eabfd776bbc953f Mon Sep 17 00:00:00 2001 From: Karl Shaffer Date: Wed, 28 Apr 2021 15:41:15 -0400 Subject: Enables --host flag for Local TF runs The cc_tf_test_launcher now checks the next positional argument for a --host flag and adds the corresponding flags to the TradeFed execution. This flag approach mimics how ATest currently handles host/device tests. Test: Manual testing, through the following steps: bazel run //build/pesto/experiments/prepare_bazel_test_env -- generate bazel run //build/pesto/experiments/prepare_bazel_test_env -- sync (For host side test) bazel test //platform_testing/tests/example/native:hello_world_test --test_output=all --test_arg=--host (For device side test, requiring a device connected and lunch selecting the correct build target) bazel test //platform_testing/tests/example/native:hello_world_test --test_output=all Change-Id: I3b92a2551a1a9d272c45cd5047f5a764d8a849c7 --- .../tests/example/native/BUILD.bazel.template | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'experiments/prepare_bazel_test_env/data/templates/platform_testing') diff --git a/experiments/prepare_bazel_test_env/data/templates/platform_testing/tests/example/native/BUILD.bazel.template b/experiments/prepare_bazel_test_env/data/templates/platform_testing/tests/example/native/BUILD.bazel.template index 4c7e3e0..6d4a026 100644 --- a/experiments/prepare_bazel_test_env/data/templates/platform_testing/tests/example/native/BUILD.bazel.template +++ b/experiments/prepare_bazel_test_env/data/templates/platform_testing/tests/example/native/BUILD.bazel.template @@ -25,18 +25,24 @@ _LIB_SRCS = glob([ "{prebuilts_dir_name}/host/lib/**/*", "{prebuilts_dir_name}/host/lib64/**/*" ]) -_TESTCASE_SRCS = glob( +_TESTCASE_HOST_SRCS = glob( ["{prebuilts_dir_name}/host/testcases/hello_world_test/**/*"]) +_TESTCASE_DEVICE_SRCS = glob(["{prebuilts_dir_name}/target_testcases/hello_world_test/**/*"]) _LIB_OUTS = [f.replace("{prebuilts_dir_name}/host/", "") for f in _LIB_SRCS] -_TESTCASE_OUTS = [ - f.replace("{prebuilts_dir_name}/host/testcases/hello_world_test/", "") - for f in _TESTCASE_SRCS +_TESTCASE_HOST_OUTS = [ + f.replace("{prebuilts_dir_name}/host/testcases/hello_world_test/", "host/") + for f in _TESTCASE_HOST_SRCS ] +_TESTCASE_DEVICE_OUTS = [ + f.replace("{prebuilts_dir_name}/target_testcases/hello_world_test/", "device/") + for f in _TESTCASE_DEVICE_SRCS +] + genrule(name="hello_world_test_prebuilt", - srcs=_LIB_SRCS + _TESTCASE_SRCS, - outs=_LIB_OUTS + _TESTCASE_OUTS, + srcs=_LIB_SRCS + _TESTCASE_HOST_SRCS + _TESTCASE_DEVICE_SRCS, + outs=_LIB_OUTS + _TESTCASE_HOST_OUTS + _TESTCASE_DEVICE_OUTS, cmd=""" src_files=($(SRCS)) out_files=($(OUTS)) -- cgit v1.2.3