sh_binary: Use pointers for optional attributes
Empty strings for filename and sub_dir were unnecessicarily always being propagated to BUILD files. Test: build/bazel/ci/bp2build.sh Change-Id: I39d6af12b1decd1d3813b92daa862ebc025daa7d
This commit is contained in:
@@ -73,3 +73,20 @@ func TestShBinarySimple(t *testing.T) {
|
||||
})},
|
||||
})
|
||||
}
|
||||
|
||||
func TestShBinaryDefaults(t *testing.T) {
|
||||
runShBinaryTestCase(t, bp2buildTestCase{
|
||||
description: "sh_binary test",
|
||||
moduleTypeUnderTest: "sh_binary",
|
||||
moduleTypeUnderTestFactory: sh.ShBinaryFactory,
|
||||
blueprint: `sh_binary {
|
||||
name: "foo",
|
||||
src: "foo.sh",
|
||||
bazel_module: { bp2build_available: true },
|
||||
}`,
|
||||
expectedBazelTargets: []string{
|
||||
makeBazelTarget("sh_binary", "foo", attrNameToString{
|
||||
"srcs": `["foo.sh"]`,
|
||||
})},
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user