diff options
author | 2016-04-28 15:47:29 +0000 | |
---|---|---|
committer | 2016-04-29 08:06:28 +0000 | |
commit | 3fedf9e618cbce3dbdd00559b2de0bb8e2d43171 (patch) | |
tree | cbe0c132f0a815bbf0bc5a85560cf33cd7118484 /src/test/java/com/google/devtools/build/lib/runtime | |
parent | 60166c5dbef131b2d0104b514fe596bd5b572f7e (diff) |
Inject the Constants.TOOLS_REPOSITORY in SkylarkRuleClassFunctions.testBaseRule
via the Skylark and delete the constant. Also, change the isLoadingPhase in the
Skylark environment an enum Phase in order to:
- Decide whether testRules are enabled or not and,
- Check that the toolsRepository is set when in the LOADING phase.
Finally, a few tests that were using ConfiguredRuleClassProvider directly
had to be updated to set a tools repository, otherwise createGlobals() fails.
--
MOS_MIGRATED_REVID=121022804
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/runtime')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/runtime/AbstractCommandTest.java | 3 | ||||
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcherRcoptionsTest.java | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/runtime/AbstractCommandTest.java b/src/test/java/com/google/devtools/build/lib/runtime/AbstractCommandTest.java index 3f745ce2cf..529200f5c6 100644 --- a/src/test/java/com/google/devtools/build/lib/runtime/AbstractCommandTest.java +++ b/src/test/java/com/google/devtools/build/lib/runtime/AbstractCommandTest.java @@ -18,6 +18,7 @@ import static org.junit.Assert.assertEquals; import com.google.common.collect.ImmutableList; import com.google.devtools.build.lib.analysis.ConfiguredRuleClassProvider; +import com.google.devtools.build.lib.testutil.TestConstants; import com.google.devtools.build.lib.util.ExitCode; import com.google.devtools.common.options.Option; import com.google.devtools.common.options.OptionsBase; @@ -76,6 +77,7 @@ public class AbstractCommandTest { @Test public void testGetOptionsYieldsAnnotatedOptions() { ConfiguredRuleClassProvider ruleClassProvider = new ConfiguredRuleClassProvider.Builder() + .setToolsRepository(TestConstants.TOOLS_REPOSITORY) .build(); assertThat( @@ -99,6 +101,7 @@ public class AbstractCommandTest { @Test public void testOptionsAreInherited() { ConfiguredRuleClassProvider ruleClassProvider = new ConfiguredRuleClassProvider.Builder() + .setToolsRepository(TestConstants.TOOLS_REPOSITORY) .build(); assertThat( BlazeCommandUtils.getOptions( diff --git a/src/test/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcherRcoptionsTest.java b/src/test/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcherRcoptionsTest.java index ad2d864a33..9398b147f5 100644 --- a/src/test/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcherRcoptionsTest.java +++ b/src/test/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcherRcoptionsTest.java @@ -32,6 +32,7 @@ import com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.LockingMode; import com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.ShutdownBlazeServerException; import com.google.devtools.build.lib.runtime.proto.InvocationPolicyOuterClass; import com.google.devtools.build.lib.testutil.Scratch; +import com.google.devtools.build.lib.testutil.TestConstants; import com.google.devtools.build.lib.util.ExitCode; import com.google.devtools.build.lib.util.io.RecordingOutErr; import com.google.devtools.common.options.Option; @@ -146,6 +147,8 @@ public class BlazeCommandDispatcherRcoptionsTest { builder.addConfigurationOptions(BuildConfiguration.Options.class); // The defaults package asserts that it is not empty, so we provide options. builder.addConfigurationOptions(MockFragmentOptions.class); + // The tools repository is needed for createGlobals + builder.setToolsRepository(TestConstants.TOOLS_REPOSITORY); } }) .setInvocationPolicy(InvocationPolicyOuterClass.InvocationPolicy.getDefaultInstance()) |