From a4ca63748f116c0e426be7710f0698518af2c043 Mon Sep 17 00:00:00 2001 From: Ulf Adams Date: Mon, 11 Jan 2016 14:20:28 +0000 Subject: BuildView - untangle more of the methods that are only for ide info. In particular, don't immediately call into the ForTesting functions; I need to refactor some code that is called from here, and the semantics when called from ide info should not change. Changes to semantics when called from tests are much less problematic - we can simply run all the tests. -- MOS_MIGRATED_REVID=111846384 --- .../build/lib/analysis/util/BuildViewTestCase.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java') diff --git a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java index 623729f18a..32f8027723 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java @@ -387,7 +387,7 @@ public abstract class BuildViewTestCase extends FoundationTestCase { * the action graph. */ protected Iterable getDirectPrerequisites(ConfiguredTarget target) - throws InterruptedException { + throws Exception { return view.getDirectPrerequisitesForTesting(reporter, target, masterConfig); } @@ -400,7 +400,7 @@ public abstract class BuildViewTestCase extends FoundationTestCase { // requesting "//go:two" as a dependency. So the configured targets aren't considered "equal". // Once we apply dynamic configs to top-level targets this discrepancy will go away. protected void assertDirectPrerequisitesContain(ConfiguredTarget target, ConfiguredTarget dep) - throws InterruptedException { + throws Exception { Iterable prereqs = getDirectPrerequisites(target); BuildConfiguration depConfig = dep.getConfiguration(); for (ConfiguredTarget contained : prereqs) { @@ -437,7 +437,7 @@ public abstract class BuildViewTestCase extends FoundationTestCase { * Creates and returns a rule context that is equivalent to the one that was used to create the * given configured target. */ - protected RuleContext getRuleContext(ConfiguredTarget target) throws InterruptedException { + protected RuleContext getRuleContext(ConfiguredTarget target) throws Exception { return view.getRuleContextForTesting( reporter, target, new StubAnalysisEnvironment(), masterConfig); } @@ -447,7 +447,7 @@ public abstract class BuildViewTestCase extends FoundationTestCase { * that was used to create the given configured target. */ protected RuleContext getRuleContextForSkylark(ConfiguredTarget target) - throws InterruptedException { + throws Exception { // TODO(bazel-team): we need this horrible workaround because CachingAnalysisEnvironment // only works with StoredErrorEventListener despite the fact it accepts the interface // ErrorEventListener, so it's not possible to create it with reporter. @@ -469,7 +469,7 @@ public abstract class BuildViewTestCase extends FoundationTestCase { * the action graph. */ protected List getPrerequisites(ConfiguredTarget target, - String attributeName) throws InterruptedException { + String attributeName) throws Exception { return getRuleContext(target).getConfiguredTargetMap().get(attributeName); } @@ -480,7 +480,7 @@ public abstract class BuildViewTestCase extends FoundationTestCase { * the action graph. */ protected Iterable getPrerequisites(ConfiguredTarget target, - String attributeName, Class classType) throws InterruptedException { + String attributeName, Class classType) throws Exception { return AnalysisUtils.getProviders(getPrerequisites(target, attributeName), classType); } @@ -491,7 +491,7 @@ public abstract class BuildViewTestCase extends FoundationTestCase { * the action graph. */ protected ImmutableList getPrerequisiteArtifacts( - ConfiguredTarget target, String attributeName) throws InterruptedException { + ConfiguredTarget target, String attributeName) throws Exception { Set result = new LinkedHashSet<>(); for (FileProvider provider : getPrerequisites(target, attributeName, FileProvider.class)) { Iterables.addAll(result, provider.getFilesToBuild()); -- cgit v1.2.3