Merge "Correct genrule path references"

This commit is contained in:
Treehugger Robot
2023-06-06 14:59:16 +00:00
committed by Gerrit Code Review
3 changed files with 14 additions and 8 deletions

View File

@@ -49,6 +49,7 @@ func otherGenruleBp(genruleTarget string) map[string]string {
srcs: ["other_tool.in"],
cmd: "cp $(in) $(out)",
}`, genruleTarget, genruleTarget),
"other/file.txt": "",
}
}
@@ -293,17 +294,20 @@ func TestGenruleSrcsLocationsAbsoluteLabel(t *testing.T) {
bp := `%s {
name: "foo",
out: ["foo.out"],
srcs: [":other.tool"],
srcs: [":other.tool", "other/file.txt",],
tool_files: [":foo.tool"],
cmd: "$(locations :foo.tool) -s $(out) $(location :other.tool)",
cmd: "$(locations :foo.tool) $(location other/file.txt) -s $(out) $(location :other.tool)",
bazel_module: { bp2build_available: true },
}`
for _, tc := range testCases {
moduleAttrs := AttrNameToString{
"cmd": `"$(locations //other:foo.tool) -s $(OUTS) $(location //other:other.tool)"`,
"outs": `["foo.out"]`,
"srcs": `["//other:other.tool"]`,
"cmd": `"$(locations //other:foo.tool) $(location //other:file.txt) -s $(OUTS) $(location //other:other.tool)"`,
"outs": `["foo.out"]`,
"srcs": `[
"//other:other.tool",
"//other:file.txt",
]`,
"tools": `["//other:foo.tool"]`,
}