Correctly copy the board configuration input variables
dict(**h[0]) was only copying the top level dictionary
object, but not any other dictionaries/lists inside of
it. This was causing us to not find all the changes to
variables the board configuration was making, and so
some variables were not included in the output.
Bug: 201700692
Test: ./build/bazel/ci/rbc_regression_test.sh mainline_system_x86_64-userdebug
Test: ./out/soong/rbcrun ./build/make/tests/run.rbc
Change-Id: I4467eead7e597f6f49119a8c4832126f39d646e7
diff --git a/tests/run.rbc b/tests/run.rbc
index 31436c5..2afee08 100644
--- a/tests/run.rbc
+++ b/tests/run.rbc
@@ -13,8 +13,8 @@
# limitations under the License.
-# Run test configuration and verify its result.
-# The main configuration file is device.rbc.
+# Run test product configuration and verify its result.
+# The main configuration file is product.rbc.
# It inherits part1.rbc and also includes include1.rbc
# TODO(asmundak): more tests are needed to verify that:
# * multi-level inheritance works as expected
@@ -22,7 +22,9 @@
load("//build/make/core:product_config.rbc", "rblf")
load(":version_defaults.rbc", "version_defaults")
-load(":device.rbc", "init")
+load(":product.rbc", "init")
+load(":board.rbc", board_init = "init")
+load(":board_input_vars.rbc", board_input_vars_init = "init")
def assert_eq(expected, actual):
if expected != actual:
@@ -110,3 +112,7 @@
},
{ k:v for k,v in sorted(goals.items()) }
)
+
+(board_globals, board_config, board_globals_base) = rblf.board_configuration(board_init, board_input_vars_init)
+assert_eq({"A_LIST_VARIABLE": ["foo", "bar"]}, board_globals)
+assert_eq({"A_LIST_VARIABLE": ["foo"]}, board_globals_base)