diff options
author | 2016-02-03 08:30:07 +0000 | |
---|---|---|
committer | 2016-02-03 22:06:07 +0000 | |
commit | 53abece6ff52869587d907a1884243e64a82592c (patch) | |
tree | 130d7185a7b52d74801c4acb661c1762212b9ba8 /src/test | |
parent | 24f04de25d6d899b35ff0541cddef432bc1aeb12 (diff) |
Correctly flag loading errors in the interleaved case.
In the interleaved case, loading errors can now also be discovered during the
analysis phase. Add a boolean flag to the SkyframeAnalysisResult to indicate
that such an error happened, and pass it through in BuildView.
Also refactor BuildView to simplify the code a bit - simply pass the
SkyframeAnalysisResult to the createResult method.
There is already an integration test for this - I'm adding a faster unit test
in BuildViewTest, as this is part of the BuildView contract.
--
MOS_MIGRATED_REVID=113716870
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java b/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java index cd7ec79b0d..ac289bb5ca 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java @@ -999,6 +999,18 @@ public class BuildViewTest extends BuildViewTestBase { assertThat(loadingFailureRecorder.events).isEmpty(); } + @Test + public void testLoadingErrorReportedCorrectly() throws Exception { + scratch.file("a/BUILD", "cc_library(name='a')"); + scratch.file("b/BUILD", "cc_library(name='b', deps = ['//missing:lib'])"); + + reporter.removeHandler(failFastHandler); + AnalysisResult result = update(defaultFlags().with(Flag.KEEP_GOING), "//a", "//b"); + assertThat(result.hasError()).isTrue(); + assertThat(result.getError()) + .contains("execution phase succeeded, but there were loading phase errors"); + } + /** Runs the same test with the reduced loading phase. */ @TestSpec(size = Suite.SMALL_TESTS) @RunWith(JUnit4.class) |