public class AndroidInstrumentationTest extends AbstractBuildRuleWithDeclaredAndExtraDeps implements ExternalTestRunnerRule, HasRuntimeDeps, TestRule
TestRule.TestReportingCallbackNOOP_REPORTING_CALLBACK| Modifier | Constructor and Description |
|---|---|
protected |
AndroidInstrumentationTest(BuildTarget buildTarget,
ProjectFilesystem projectFilesystem,
AndroidPlatformTarget androidPlatformTarget,
BuildRuleParams params,
HasInstallableApk apk,
Set<String> labels,
Set<String> contacts,
Tool javaRuntimeLauncher,
Optional<Long> testRuleTimeoutMs,
PackagedResource ddmlibJar,
PackagedResource kxml2Jar,
PackagedResource guavaJar,
PackagedResource toolsCommonJar) |
| Modifier and Type | Method and Description |
|---|---|
HasInstallableApk |
getApk() |
com.google.common.collect.ImmutableList<Step> |
getBuildSteps(BuildContext context,
BuildableContext buildableContext) |
com.google.common.collect.ImmutableSet<String> |
getContacts() |
ExternalTestSpec |
getExternalTestRunnerSpec(ExecutionContext executionContext,
TestRunningOptions testRunningOptions,
BuildContext buildContext) |
com.google.common.collect.ImmutableSet<String> |
getLabels() |
Path |
getPathToTestOutputDirectory() |
protected static com.google.common.collect.ImmutableList<Path> |
getRequiredPaths(HasInstallableApk apkInstance,
Optional<Path> instrumentationApkPath,
Optional<Path> apkUnderTestPath) |
java.util.stream.Stream<BuildTarget> |
getRuntimeDeps(BuildRuleResolver buildRuleResolver) |
SourcePath |
getSourcePathToOutput() |
Callable<TestResults> |
interpretTestResults(ExecutionContext context,
SourcePathResolverAdapter pathResolver,
boolean isUsingTestSelectors) |
void |
onPreTest(BuildContext buildContext)
Called in order to perform setup for external tests.
|
com.google.common.collect.ImmutableList<Step> |
runTests(ExecutionContext executionContext,
TestRunningOptions options,
BuildContext buildContext,
TestRule.TestReportingCallback testReportingCallback)
Returns the commands required to run the tests.
|
boolean |
runTestSeparately() |
boolean |
supportsStreamingTests() |
deprecatedGetExtraDeps, getBuildDeps, getDeclaredDeps, getTargetGraphOnlyDepsequals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, getType, hasBuildSteps, hashCode, injectFields, isCacheable, toString, updateBuildRuleResolverclone, finalize, getClass, notify, notifyAll, wait, wait, waitcompareTo, getBuildDeps, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, hasBuildSteps, isCacheable, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toString, updateBuildRuleResolvergetDependencies, getSourcePathOutputsgetTypeprotected AndroidInstrumentationTest(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, AndroidPlatformTarget androidPlatformTarget, BuildRuleParams params, HasInstallableApk apk, Set<String> labels, Set<String> contacts, Tool javaRuntimeLauncher, Optional<Long> testRuleTimeoutMs, PackagedResource ddmlibJar, PackagedResource kxml2Jar, PackagedResource guavaJar, PackagedResource toolsCommonJar)
public com.google.common.collect.ImmutableSet<String> getLabels()
public com.google.common.collect.ImmutableSet<String> getContacts()
getContacts in interface TestRulepublic boolean supportsStreamingTests()
supportsStreamingTests in interface TestRulerunTests() on this rule invokes the callbacks in testReportingCallback as the tests run, false otherwise.public com.google.common.collect.ImmutableList<Step> runTests(ExecutionContext executionContext, TestRunningOptions options, BuildContext buildContext, TestRule.TestReportingCallback testReportingCallback)
TestRuleNote: This method may be run without BuildEngine.build(com.facebook.buck.core.build.engine.BuildEngineBuildContext,
ExecutionContext, BuildRule) having been run. This happens if the user has built [and ran] the
test previously and then re-runs it using the --debug flag.
public Path getPathToTestOutputDirectory()
getPathToTestOutputDirectory in interface TestRulepublic Callable<TestResults> interpretTestResults(ExecutionContext context, SourcePathResolverAdapter pathResolver, boolean isUsingTestSelectors)
interpretTestResults in interface TestRulepublic SourcePath getSourcePathToOutput()
getSourcePathToOutput in interface BuildRulepublic final com.google.common.collect.ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext)
getBuildSteps in interface BuildRulepublic boolean runTestSeparately()
runTestSeparately in interface TestRulepublic void onPreTest(BuildContext buildContext)
onPreTest in interface ExternalTestRunnerRulepublic ExternalTestSpec getExternalTestRunnerSpec(ExecutionContext executionContext, TestRunningOptions testRunningOptions, BuildContext buildContext)
getExternalTestRunnerSpec in interface ExternalTestRunnerRuleprotected static com.google.common.collect.ImmutableList<Path> getRequiredPaths(HasInstallableApk apkInstance, Optional<Path> instrumentationApkPath, Optional<Path> apkUnderTestPath)
public java.util.stream.Stream<BuildTarget> getRuntimeDeps(BuildRuleResolver buildRuleResolver)
getRuntimeDeps in interface HasRuntimeDepspublic HasInstallableApk getApk()