[bazel] Add skia_android_unit_test macro.

This CL defines a generic (i.e. non Android specific) skia_test macro that compiles a Skia C++ unit test with cc_binary_with_flags, and a wrapper test runner script that passes any necessary command-line arguments to the C++ binary. The test wrapper script is exposed to Bazel as a sh_test.

Then, this CL defines a skia_android_unit_test macro that compiles one or more C++ unit tests into a single Android binary and produces a script that runs the test on an attached Android device via adb. See the docstring for details.

Note to reviewer: The skia_test macro is similar enough to the existing skia_cpu_tests and skia_ganesh_tests macros that we could rewrite them as wrappers around skia_test, but that's out of scope for this CL.

Suggested review order:
- //tests/BUILD.bazel
- //tests/android.bzl

Bug: skia:14227
Change-Id: I43c38d530c4b2562673f319ea9dc87d3734cbb10
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/668876
Commit-Queue: Leandro Lovisolo <lovisolo@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
10 files changed