1 2# Copyright 2021 Google LLC 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# https://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16 17# Run test configuration and verify its result. 18# The main configuration file is device.rbc. 19# It inherits part1.rbc and also includes include1.rbc 20# TODO(asmundak): more tests are needed to verify that: 21# * multi-level inheritance works as expected 22# * all runtime functions (wildcard, regex, etc.) work 23 24load("//build/make/core:product_config.rbc", "rblf") 25load(":device.rbc", "init") 26 27def assert_eq(expected, actual): 28 if expected != actual: 29 fail("Expected %s, got %s" % (expected, actual)) 30 31 32globals, config = rblf.product_configuration("test/device", init) 33assert_eq( 34 { 35 "PRODUCT_COPY_FILES": [ 36 "part_from:part_to", 37 "device_from:device_to", 38 "device/google/redfin/audio/audio_platform_info_noextcodec_snd.xml:||VENDOR-PATH-PH||/etc/audio_platform_info_noextcodec_snd.xml", 39 "xyz" 40 ], 41 "PRODUCT_HOST_PACKAGES": ["host"], 42 "PRODUCT_PACKAGES": [ 43 "dev", 44 "inc", 45 "dev_after" 46 ], 47 "PRODUCT_PRODUCT_PROPERTIES": ["part_properties"] 48 }, 49 { k:v for k, v in sorted(config.items()) } 50) 51