diff options
author | ulfjack <ulfjack@google.com> | 2017-12-04 05:48:31 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2017-12-04 05:50:29 -0800 |
commit | 515ba8967aeb32be50783bf6c60f0de6e6bdba8d (patch) | |
tree | e0c39b3887593e8142e4028c8d6f5b4e058b2a29 /src/test/java/com/google/devtools | |
parent | 7cf1c694a3f949717be06b3b6c8e6a20e22cb83f (diff) |
Switch GenRuleBase to use the new Expander API
This is a roll-forward of https://github.com/bazelbuild/bazel/commit/e8d32b7c922f65539b74357711d5ad6b70934115, which broke some genrules, but without
some cleanup changes which I'm submitting separately, and with a fix for the
bug.
The problem was that I switched from withExecLocations(labels) to
withExecLocations(); the original code was in CommandHelper, and the new
code in GenRuleBase, so this was not obvious.
Also, we didn't have test coverage for this case - note that the specified
labels are _added_ to the default map of labels, rather than replacing the
default map of labels. This only matters if the dependent rule provides a
GenRuleSourcesProvider, which only a single (Google-internal) rule does.
PiperOrigin-RevId: 177802902
Diffstat (limited to 'src/test/java/com/google/devtools')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/bazel/rules/genrule/GenRuleCommandSubstitutionTest.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/bazel/rules/genrule/GenRuleCommandSubstitutionTest.java b/src/test/java/com/google/devtools/build/lib/bazel/rules/genrule/GenRuleCommandSubstitutionTest.java index 8b2b1d4eaa..bef6e1c4b8 100644 --- a/src/test/java/com/google/devtools/build/lib/bazel/rules/genrule/GenRuleCommandSubstitutionTest.java +++ b/src/test/java/com/google/devtools/build/lib/bazel/rules/genrule/GenRuleCommandSubstitutionTest.java @@ -93,7 +93,7 @@ public class GenRuleCommandSubstitutionTest extends BuildViewTestCase { eventCollector.clear(); genrule("$(location foo bar"); - assertExpansionFails("unterminated $(location) expression", "//test"); + assertExpansionFails("unterminated variable reference", "//test"); genrule("$(location"); assertExpansionFails("unterminated variable reference", "//test"); @@ -221,7 +221,7 @@ public class GenRuleCommandSubstitutionTest extends BuildViewTestCase { eventCollector.clear(); genrule("$(locations foo bar"); - assertExpansionFails("unterminated $(locations) expression", "//test"); + assertExpansionFails("unterminated variable reference", "//test"); genrule("$(locations"); assertExpansionFails("unterminated variable reference", "//test"); |