summaryrefslogtreecommitdiff
path: root/mk2rbc/mk2rbc_test.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2022-02-08 11:56:25 -0800
committer Cole Faust <colefaust@google.com> 2022-02-09 14:15:47 -0800
commit9932f75151c2eb6ac3069496cb9596292d0af797 (patch)
treef05258e928bc4475237571e205af35add1d11d85 /mk2rbc/mk2rbc_test.go
parent3e7f5c411dfed43cb08f7b4a4c0d5220cdcd3c8c (diff)
Allow filter calls with a list as a pattern
This commit doesn't attempt to replace the filter calls with anything more idomatic for now. It also removes the case for filter-out, because the actual function name is filter_out and wasn't being used anyways. Even if I were to change it to filter_out, that would produce buggy results: ifneq (,$(filter $(TARGET_BUILD_VARIANT), userdebug eng)) endif ifneq (,$(filter-out $(TARGET_BUILD_VARIANT), userdebug eng)) endif Both of these would produce: if g["TARGET_BUILD_VARIANT"] in ["userdebug", "eng"]: pass Fixes: 218702402 Test: go test Change-Id: I566079e5d3a364c42db14045aa1bab9d99eba05f
Diffstat (limited to 'mk2rbc/mk2rbc_test.go')
-rw-r--r--mk2rbc/mk2rbc_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/mk2rbc/mk2rbc_test.go b/mk2rbc/mk2rbc_test.go
index 2083121ab..55e37fef0 100644
--- a/mk2rbc/mk2rbc_test.go
+++ b/mk2rbc/mk2rbc_test.go
@@ -389,6 +389,10 @@ ifneq (,$(filter plaf,$(PLATFORM_LIST)))
endif
ifeq ($(TARGET_BUILD_VARIANT), $(filter $(TARGET_BUILD_VARIANT), userdebug eng))
endif
+ifneq (, $(filter $(TARGET_BUILD_VARIANT), userdebug eng))
+endif
+ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
+endif
ifneq (,$(filter true, $(v1)$(v2)))
endif
ifeq (,$(filter barbet coral%,$(TARGET_PRODUCT)))
@@ -407,8 +411,12 @@ def init(g, handle):
pass
if "plaf" in g.get("PLATFORM_LIST", []):
pass
+ if g["TARGET_BUILD_VARIANT"] == " ".join(rblf.filter(g["TARGET_BUILD_VARIANT"], "userdebug eng")):
+ pass
if g["TARGET_BUILD_VARIANT"] in ["userdebug", "eng"]:
pass
+ if rblf.filter("userdebug eng", g["TARGET_BUILD_VARIANT"]):
+ pass
if rblf.filter("true", "%s%s" % (_v1, _v2)):
pass
if not rblf.filter("barbet coral%", g["TARGET_PRODUCT"]):