Skip to content

Latest commit

 

History

History
55 lines (51 loc) · 2.15 KB

android_instrumentation_test.md

File metadata and controls

55 lines (51 loc) · 2.15 KB

/* * Copyright (c) Facebook, Inc. and its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ {namespace android_instrumentation_test} /***/ {template .soyweb} {call buck.page} {param title: 'android_instrumentation_test()' /} {param navid: 'rule_android_instrumentation_test' /} {param prettify: true /} {param description} A rule that is used to run Android instrumentation tests. {/param} {param content} {call buck.rule} {param status: 'UNFROZEN' /} {param overview} A android_instrumentation_test() rule is used to define apks that should be used to run Android instrumentation tests. {/param} {param args} {call buck.name_arg /} {call buck.arg} {param name: 'apk' /} {param desc} The APK containing the tests. Can be an {call buck.android_binary /}, an {call buck.apk_genrule /} or an {call buck.android_instrumentation_apk /}. {/param} {/call} {call buck.test_label_arg /} {call buck.test_rule_timeout_ms /} {call test_common.contacts_arg /} {/param} // close args {param examples} Here is an example of an android_instrumentation_test() {sp}rule that tests an android_binary(). {literal}

android_binary(
  name = 'messenger',
  manifest = 'AndroidManifest.xml',
  keystore = '//keystores:prod',
  package_type = 'release',
  proguard_config = 'proguard.cfg',
  deps = [
    ...
  ],
)

android_instrumentation_apk(
  name = 'messenger_test',
  manifest = 'AndroidInstrumentationManifest.xml',
  apk = ':messenger',
  deps = [
    ...
  ],
)

android_instrumentation_test(
  name = 'messenger_instrumentation_test',
  apk = ':messenger_test',
)

{/literal} {/param} {/call} // close buck.rule {/param} {/call} {/template}