diff options
author | Sasha Smundak <asmundak@google.com> | 2021-09-17 15:27:37 -0700 |
---|---|---|
committer | Sasha Smundak <asmundak@google.com> | 2021-10-25 10:41:46 -0700 |
commit | dc154164db6fc625ffeee9134cf1503ae82df44c (patch) | |
tree | 714725d8ff3174d9e021858aad3ca3e100a32aef /tests | |
parent | da2f56ebe460ee0b0aad308897498e7e63b2775b (diff) | |
download | build-dc154164db6fc625ffeee9134cf1503ae82df44c.tar.gz |
Better Soong namespace support in the RBC runtime.
Includes:
* Defining namespace again should have no effect
* Allow appending to a variable defined in a namespace
* Consistent naming
* Print namespace variable assignments even if they are empty
Bug: 200297238
Test: rbcrun make/build/tests/run.rbc
Change-Id: I64aa22c4498ae89e4bc3a077d6206ad37d5c7c38
Diffstat (limited to 'tests')
-rw-r--r-- | tests/device.rbc | 20 | ||||
-rw-r--r-- | tests/part1.rbc | 2 | ||||
-rw-r--r-- | tests/run.rbc | 2 |
3 files changed, 12 insertions, 12 deletions
diff --git a/tests/device.rbc b/tests/device.rbc index feefcf716b..1aa2290986 100644 --- a/tests/device.rbc +++ b/tests/device.rbc @@ -23,12 +23,11 @@ ### PRODUCT_PACKAGES += dev_after ### PRODUCT_COPY_FILES += $(call find-copy-subdir-files,audio_platform_info*.xml,device/google/redfin/audio,$(TARGET_COPY_OUT_VENDOR)/etc) xyz:/etc/xyz ### PRODUCT_COPY_FILES += $(call copy-files,x.xml y.xml,/etc) -### $(call add_soong_namespace,NS1) -### $(call add_soong_config_var_value,NS1,v1,abc) -### $(call add_soong_config_var_value,NS1,v2,def) -### $(call add_soong_namespace,NS2) +### $(call add_soong_config_namespace,NS1) +### $(call soong_config_append,NS1,v1,abc) +### $(call soong_config_append,NS1,v2,def) ### $(call add_soong_config_var_value,NS2,v3,abc) -### $(call add_soong_config_var_value,NS2,v3,xyz) +### $(call soong_config_set,NS2,v3,xyz) load("//build/make/core:product_config.rbc", "rblf") load(":part1.rbc", _part1_init = "init") @@ -50,10 +49,9 @@ def init(g, handle): cfg["PRODUCT_COPY_FILES"] += rblf.copy_files("x.xml y.xml", "/etc") cfg["PRODUCT_COPY_FILES"] += rblf.copy_files(["from/sub/x", "from/sub/y"], "to") - rblf.add_soong_config_namespace(g, "NS1") - rblf.add_soong_config_var_value(g, "NS1", "v1", "abc") - rblf.add_soong_config_var_value(g, "NS1", "v2", "def") - rblf.add_soong_config_namespace(g, "NS2") - rblf.add_soong_config_var_value(g, "NS2", "v3", "abc") - rblf.add_soong_config_var_value(g, "NS2", "v3", "xyz") + rblf.soong_config_namespace(g, "NS1") + rblf.soong_config_append(g, "NS1", "v1", "abc") + rblf.soong_config_append(g, "NS1", "v2", "def") + rblf.soong_config_set(g, "NS2", "v3", "abc") + rblf.soong_config_set(g, "NS2", "v3", "xyz") diff --git a/tests/part1.rbc b/tests/part1.rbc index 3e50751026..ae79d32bfd 100644 --- a/tests/part1.rbc +++ b/tests/part1.rbc @@ -26,3 +26,5 @@ def init(g, handle): cfg["PRODUCT_COPY_FILES"] += ["part_from:part_to"] rblf.setdefault(handle, "PRODUCT_PRODUCT_PROPERTIES") cfg["PRODUCT_PRODUCT_PROPERTIES"] += ["part_properties"] + rblf.soong_config_namespace(g, "NS1") + rblf.soong_config_append(g, "NS1", "v1", "abc_part1") diff --git a/tests/run.rbc b/tests/run.rbc index eef217ba75..6dcd37c1ac 100644 --- a/tests/run.rbc +++ b/tests/run.rbc @@ -80,7 +80,7 @@ ns = globals["$SOONG_CONFIG_NAMESPACES"] assert_eq( { "NS1": { - "v1": "abc", + "v1": "abc abc_part1", "v2": "def" }, "NS2": { |