diff options
author | jingwen <jingwen@google.com> | 2017-12-19 09:30:45 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2017-12-19 09:32:20 -0800 |
commit | 741dbc081e2479fd8b0b9c289802b8a0e4af7c06 (patch) | |
tree | 45430c4303439099540e77619f3c1b949e2416be /src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java | |
parent | 691bd158149602aeb6bbcc46fd4b22367d0157b4 (diff) |
Ensure that the target package in the <instrumentation> tag of the instrumentation android_binary's AndroidManifest.xml references the correct package name of the instrumented android_binary.
During an instrumentation test, ART will use the targetPackage specified in the instrumentation APK's AndroidManifest to determine the application to be instrumented. We can perform this check in Bazel at execution time, before the apps are loaded onto the device.
See android_instrumentation_test_integration_test.sh for the e2e example.
GITHUB: https://github.com/bazelbuild/bazel/issues/903
RELNOTES: None.
PiperOrigin-RevId: 179564246
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java index 30e26d1803..cc3d44e9fc 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java @@ -56,8 +56,8 @@ public class AndroidInstrumentationTest implements RuleConfiguredTargetFactory { ruleContext.throwWithAttributeError( "instrumentation", String.format( - "The android_binary target at %s is missing an 'instruments' attribute. Please set " - + "it as the label of the android_binary under test.", + "The android_binary target %s is missing an 'instruments' attribute. Please set " + + "it to the label of the android_binary under test.", ruleContext.attributes().get("instrumentation", BuildType.LABEL))); } } |