Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

Commit 468c76d

Browse files
bobyangyffacebook-github-bot
authored andcommitted
Change RunnerLibrary to TestRunner
Summary: this renames the runner_library field on the test rules to be just runner. This makes more sense since we are now specifying the runners with special runner rules instead of just a generic library. Reviewed By: miaoyipu shipit-source-id: a9faec0d15
1 parent 0a29434 commit 468c76d

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/com/facebook/buck/core/test/rule/HasTestRunnerLibrary.java src/com/facebook/buck/core/test/rule/HasTestRunner.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
*
2727
* <p>TODO(bobyf): need a slightly better api or a new rule as a library doesn't quite make sense.
2828
*/
29-
public interface HasTestRunnerLibrary {
29+
public interface HasTestRunner {
3030

3131
/** @return the target to the library containing the test runner */
32-
Optional<BuildTarget> getRunnerLibrary();
32+
Optional<BuildTarget> getRunner();
3333

3434
/**
3535
* @return the freeform (for now) specs as required for running tests. For example, cmds,

src/com/facebook/buck/features/go/GoTestDescription.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import com.facebook.buck.core.rules.impl.NoopBuildRuleWithDeclaredAndExtraDeps;
4040
import com.facebook.buck.core.sourcepath.SourcePath;
4141
import com.facebook.buck.core.sourcepath.resolver.impl.DefaultSourcePathResolver;
42-
import com.facebook.buck.core.test.rule.HasTestRunnerLibrary;
42+
import com.facebook.buck.core.test.rule.HasTestRunner;
4343
import com.facebook.buck.core.toolchain.ToolchainProvider;
4444
import com.facebook.buck.core.toolchain.tool.Tool;
4545
import com.facebook.buck.core.util.immutables.BuckStyleImmutable;
@@ -260,10 +260,10 @@ public BuildRule createBuildRule(
260260
GoBinary testMain;
261261
if (args.getSpecs().isPresent()) {
262262
UserVerify.checkArgument(
263-
args.getRunnerLibrary().isPresent(),
263+
args.getRunner().isPresent(),
264264
"runner_library should be specified for rules implementing test protocol");
265265

266-
BuildRule library = graphBuilder.requireRule(args.getRunnerLibrary().get());
266+
BuildRule library = graphBuilder.requireRule(args.getRunner().get());
267267
UserVerify.verify(
268268
library instanceof GoLibrary, "runner_library should be a go_library for go_test");
269269
GoLibrary runnerLibrary = (GoLibrary) library;
@@ -552,7 +552,7 @@ interface AbstractGoTestDescriptionArg
552552
HasContacts,
553553
HasDeclaredDeps,
554554
HasSrcs,
555-
HasTestRunnerLibrary,
555+
HasTestRunner,
556556
HasTestTimeout,
557557
HasGoLinkable {
558558
Optional<BuildTarget> getLibrary();

src/com/facebook/buck/jvm/java/JavaTestDescription.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import com.facebook.buck.core.sourcepath.BuildTargetSourcePath;
3434
import com.facebook.buck.core.sourcepath.SourcePath;
3535
import com.facebook.buck.core.sourcepath.resolver.impl.DefaultSourcePathResolver;
36-
import com.facebook.buck.core.test.rule.HasTestRunnerLibrary;
36+
import com.facebook.buck.core.test.rule.HasTestRunner;
3737
import com.facebook.buck.core.toolchain.ToolchainProvider;
3838
import com.facebook.buck.core.util.immutables.BuckStyleImmutable;
3939
import com.facebook.buck.cxx.CxxDescriptionEnhancer;
@@ -165,7 +165,7 @@ public BuildRule createBuildRule(
165165
.setExpanders(MACRO_EXPANDERS)
166166
.build();
167167

168-
Optional<BuildTarget> runner = args.getRunnerLibrary();
168+
Optional<BuildTarget> runner = args.getRunner();
169169
Optional<ImmutableMap<String, StringWithMacros>> runnerSpecs = args.getSpecs();
170170
if (runnerSpecs.isPresent()) {
171171
JavaTestRunner testRunner;
@@ -306,7 +306,7 @@ default ForkMode getForkMode() {
306306

307307
@BuckStyleImmutable
308308
@Value.Immutable
309-
interface AbstractJavaTestDescriptionArg extends CoreArg, HasTestRunnerLibrary {}
309+
interface AbstractJavaTestDescriptionArg extends CoreArg, HasTestRunner {}
310310

311311
public static class CxxLibraryEnhancement {
312312
public final BuildRuleParams updatedParams;

test/com/facebook/buck/features/go/testdata/go_test/BUCK.fixture

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ go_test(
3232
"resources_test.go",
3333
],
3434
resources = ["testdata/input"],
35-
runner_library = ":runner",
35+
runner = ":runner",
3636
specs = {
3737
"my": "spec",
3838
"cmd": "out=\"$(abs_output testbin)\" && cd \$(dirname $out) && $out",

test/com/facebook/buck/jvm/java/testdata/testx_rule/BUCK.fixture

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ java_test_runner(
77
java_test(
88
name = "some_test",
99
srcs = ["SomeTest.java"],
10-
runner_library = ":runner",
10+
runner = ":runner",
1111
specs = {
1212
"my": "spec",
1313
"cmd": "java -jar $(abs_output testbin) $(abs_output classnames)",

0 commit comments

Comments
 (0)