Handle include statements with trailing whitespace
Fixes: 303832950 Test: go test Change-Id: I919556ee43a60f59dbd7c040025f01abb53da2a8
This commit is contained in:
@@ -192,6 +192,31 @@ def init(g, handle):
|
||||
`,
|
||||
},
|
||||
|
||||
{
|
||||
desc: "Include with trailing whitespace",
|
||||
mkname: "product.mk",
|
||||
in: `
|
||||
# has a trailing whitespace after cfg.mk
|
||||
include vendor/$(foo)/cfg.mk
|
||||
`,
|
||||
expected: `# has a trailing whitespace after cfg.mk
|
||||
load("//build/make/core:product_config.rbc", "rblf")
|
||||
load("//vendor/foo1:cfg.star|init", _cfg_init = "init")
|
||||
load("//vendor/bar/baz:cfg.star|init", _cfg1_init = "init")
|
||||
|
||||
def init(g, handle):
|
||||
cfg = rblf.cfg(handle)
|
||||
_entry = {
|
||||
"vendor/foo1/cfg.mk": ("vendor/foo1/cfg", _cfg_init),
|
||||
"vendor/bar/baz/cfg.mk": ("vendor/bar/baz/cfg", _cfg1_init),
|
||||
}.get("vendor/%s/cfg.mk" % _foo)
|
||||
(_varmod, _varmod_init) = _entry if _entry else (None, None)
|
||||
if not _varmod_init:
|
||||
rblf.mkerror("product.mk", "Cannot find %s" % ("vendor/%s/cfg.mk" % _foo))
|
||||
_varmod_init(g, handle)
|
||||
`,
|
||||
},
|
||||
|
||||
{
|
||||
desc: "Synonymous inherited configurations",
|
||||
mkname: "path/product.mk",
|
||||
|
Reference in New Issue
Block a user