diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/analysis/constraints/ConstraintsTest.java | 80 |
1 files changed, 58 insertions, 22 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/constraints/ConstraintsTest.java b/src/test/java/com/google/devtools/build/lib/analysis/constraints/ConstraintsTest.java index 0aa30d4273..a3f82cbc6e 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/constraints/ConstraintsTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/constraints/ConstraintsTest.java @@ -1060,9 +1060,14 @@ public class ConstraintsTest extends AbstractConstraintsTest { reporter.removeHandler(failFastHandler); // Invalid because "--define mode=a" refines :lib to "compatible_with = []" (empty). assertThat(getConfiguredTarget("//hello:lib")).isNull(); - assertContainsEvent("//hello:lib: the current command-line flags disqualify all supported " - + "environments because of incompatible select() paths:\n" - + " environment: //buildenv/foo:b removed by: //hello:lib (/workspace/hello/BUILD:1:1)"); + assertContainsEvent("" + + "//hello:lib: the current command line flags disqualify all supported environments " + + "because of incompatible select() paths:\n" + + " \n" + + " environment: //buildenv/foo:b\n" + + " removed by: //hello:lib (/workspace/hello/BUILD:1:1)\n" + + " which has a select() that chooses dep: //deps:dep_a\n" + + " which lacks: //buildenv/foo:b"); } @Test @@ -1110,9 +1115,14 @@ public class ConstraintsTest extends AbstractConstraintsTest { reporter.removeHandler(failFastHandler); // Invalid because "--define mode=a" refines :lib to "compatible_with = ['//buildenv/foo:a']". assertThat(getConfiguredTarget("//hello:depender")).isNull(); - assertContainsEvent("//hello:depender: the current command-line flags disqualify all supported " - + "environments because of incompatible select() paths:\n" - + " environment: //buildenv/foo:b removed by: //hello:lib (/workspace/hello/BUILD:1:1)"); + assertContainsEvent("" + + "//hello:depender: the current command line flags disqualify all supported environments " + + "because of incompatible select() paths:\n" + + " \n" + + " environment: //buildenv/foo:b\n" + + " removed by: //hello:lib (/workspace/hello/BUILD:1:1)\n" + + " which has a select() that chooses dep: //deps:dep_a\n" + + " which lacks: //buildenv/foo:b"); } @Test @@ -1145,9 +1155,14 @@ public class ConstraintsTest extends AbstractConstraintsTest { reporter.removeHandler(failFastHandler); // Invalid because "--define mode=a" refines :lib to "compatible_with = ['//buildenv/foo:a']". assertThat(getConfiguredTarget("//hello:depender")).isNull(); - assertContainsEvent("//hello:depender: the current command-line flags disqualify all supported " - + "environments because of incompatible select() paths:\n" - + " environment: //buildenv/foo:b removed by: //hello:lib2 (/workspace/hello/BUILD:1:1)"); + assertContainsEvent("" + + "//hello:depender: the current command line flags disqualify all supported environments " + + "because of incompatible select() paths:\n" + + " \n" + + " environment: //buildenv/foo:b\n" + + " removed by: //hello:lib2 (/workspace/hello/BUILD:1:1)\n" + + " which has a select() that chooses dep: //deps:dep_a\n" + + " which lacks: //buildenv/foo:b"); } @Test @@ -1167,9 +1182,14 @@ public class ConstraintsTest extends AbstractConstraintsTest { // Invalid because :lib has an implicit default of ['//buildenv/foo:b'] and "--define mode=a" // refines it to "compatible_with = []" (empty). assertThat(getConfiguredTarget("//hello:lib")).isNull(); - assertContainsEvent("//hello:lib: the current command-line flags disqualify all supported " - + "environments because of incompatible select() paths:\n" - + " environment: //buildenv/foo:b removed by: //hello:lib (/workspace/hello/BUILD:1:1)"); + assertContainsEvent("" + + "//hello:lib: the current command line flags disqualify all supported environments " + + "because of incompatible select() paths:\n" + + " \n" + + " environment: //buildenv/foo:b\n" + + " removed by: //hello:lib (/workspace/hello/BUILD:1:1)\n" + + " which has a select() that chooses dep: //deps:dep_a\n" + + " which lacks: //buildenv/foo:b"); } @Test @@ -1199,9 +1219,14 @@ public class ConstraintsTest extends AbstractConstraintsTest { // Invalid because while the //buildenv/foo refinement successfully refines :lib to // ['//buildenv/foo:a'], the bar refinement refines it to []. assertThat(getConfiguredTarget("//hello:lib")).isNull(); - assertContainsEvent("//hello:lib: the current command-line flags disqualify all supported " - + "environments because of incompatible select() paths:\n" - + " environment: //buildenv/bar:c removed by: //hello:lib (/workspace/hello/BUILD:1:1)"); + assertContainsEvent("" + + "//hello:lib: the current command line flags disqualify all supported environments " + + "because of incompatible select() paths:\n" + + " \n" + + " environment: //buildenv/bar:c\n" + + " removed by: //hello:lib (/workspace/hello/BUILD:1:1)\n" + + " which has a select() that chooses dep: //deps:dep_a\n" + + " which lacks: //buildenv/bar:c"); } /** @@ -1232,12 +1257,23 @@ public class ConstraintsTest extends AbstractConstraintsTest { useConfiguration("--define", "mode=a"); reporter.removeHandler(failFastHandler); assertThat(getConfiguredTarget("//hello:lib")).isNull(); - assertContainsEvent("//hello:lib: the current command-line flags disqualify all supported " - + "environments because of incompatible select() paths:\n" - + "\nenvironment group: //buildenv/foo:foo:\n" - + " environment: //buildenv/foo:a removed by: //hello:lib (/workspace/hello/BUILD:9:1)\n" - + "\nenvironment group: //buildenv/bar:bar:\n" - + " environment: //buildenv/bar:c removed by: //hello:lib (/workspace/hello/BUILD:9:1)"); + assertContainsEvent("" + + "//hello:lib: the current command line flags disqualify all supported environments " + + "because of incompatible select() paths:\n" + + " \n" + + "environment group: //buildenv/foo:foo:\n" + + " \n" + + " environment: //buildenv/foo:a\n" + + " removed by: //hello:lib (/workspace/hello/BUILD:9:1)\n" + + " which has a select() that chooses dep: //hello:all_groups_gone\n" + + " which lacks: //buildenv/foo:a\n" + + " \n" + + "environment group: //buildenv/bar:bar:\n" + + " \n" + + " environment: //buildenv/bar:c\n" + + " removed by: //hello:lib (/workspace/hello/BUILD:9:1)\n" + + " which has a select() that chooses dep: //hello:all_groups_gone\n" + + " which lacks: //buildenv/bar:c"); } private void writeRulesForRefiningSubsetTests(String topLevelRestrictedTo) throws Exception { @@ -1281,7 +1317,7 @@ public class ConstraintsTest extends AbstractConstraintsTest { writeRulesForRefiningSubsetTests("b"); reporter.removeHandler(failFastHandler); assertThat(getConfiguredTarget("//hello:lib")).isNull(); - assertContainsEvent("//hello:lib: the current command-line flags disqualify all supported " + assertContainsEvent("//hello:lib: the current command line flags disqualify all supported " + "environments because of incompatible select() paths"); } } |