Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42ce2b11 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Make clear_var_list set nonexistant variables to empty strings" am:...

Merge "Make clear_var_list set nonexistant variables to empty strings" am: 8998fd72 am: e2e127b2 am: 33b7fcd3

Original change: https://android-review.googlesource.com/c/platform/build/+/2351362



Change-Id: If1e41ec30735f5d244a6d5123a1d6da4bf96e05b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 2c7472c6 33b7fcd3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -860,6 +860,10 @@ def _clear_var_list(g, h, var_list):
        if v in cfg:
            cfg[v] = __zero_value(cfg[v])

        if v not in cfg and v not in g:
            # Cause the variable to appear set like the make version does
            g[v] = ""


def __get_options():
    """Returns struct containing runtime global settings."""
+2 −1
Original line number Diff line number Diff line
@@ -164,13 +164,14 @@ assert_eq({"A_LIST_VARIABLE": ["foo"]}, board_globals_base)

g = {"FOO": "a", "BAR": "c", "BAZ": "e"}
cfg = {"FOO": "b", "BAR": "d", "BAZ": "f"}
rblf.clear_var_list(g, struct(cfg=cfg), "FOO BAR")
rblf.clear_var_list(g, struct(cfg=cfg), "FOO BAR NEWVAR")
assert_eq("", g["FOO"])
assert_eq("", cfg["FOO"])
assert_eq("", g["BAR"])
assert_eq("", cfg["BAR"])
assert_eq("e", g["BAZ"])
assert_eq("f", cfg["BAZ"])
assert_eq("", g.get("NEWVAR"))

test_single_value_inheritance()
test_artifact_path_requirements()