diff options
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java | 17 |
1 files changed, 17 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 b0a5585470..ae217d3b54 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 @@ -1108,6 +1108,23 @@ public class BuildViewTest extends BuildViewTestBase { } @Test + public void testMissingXcodeVersion() throws Exception { + // The xcode_version flag uses yet another code path on top of the redirect chaser. + // Note that the redirect chaser throws if it can't find a package, but doesn't throw if it + // can't find a label in a package - that's why we use an empty package here. + scratch.file("xcode/BUILD"); + useConfiguration("--xcode_version=1.2", "--xcode_version_config=//xcode:does_not_exist"); + reporter.removeHandler(failFastHandler); + try { + update(defaultFlags().with(Flag.KEEP_GOING)); + fail(); + } catch (InvalidConfigurationException e) { + assertThat(e).hasMessageThat().contains("//xcode:does_not_exist"); + } + } + + + @Test public void testVisibilityReferencesNonexistentPackage() throws Exception { scratch.file("z/a/BUILD", "py_library(name='a', visibility=['//nonexistent:nothing'])"); |