1*9e94795aSAndroid Build Coastguard Worker# Copyright 2022 Google LLC 2*9e94795aSAndroid Build Coastguard Worker# 3*9e94795aSAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); 4*9e94795aSAndroid Build Coastguard Worker# you may not use this file except in compliance with the License. 5*9e94795aSAndroid Build Coastguard Worker# You may obtain a copy of the License at 6*9e94795aSAndroid Build Coastguard Worker# 7*9e94795aSAndroid Build Coastguard Worker# https://www.apache.org/licenses/LICENSE-2.0 8*9e94795aSAndroid Build Coastguard Worker# 9*9e94795aSAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 10*9e94795aSAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, 11*9e94795aSAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12*9e94795aSAndroid Build Coastguard Worker# See the License for the specific language governing permissions and 13*9e94795aSAndroid Build Coastguard Worker# limitations under the License. 14*9e94795aSAndroid Build Coastguard Worker 15*9e94795aSAndroid Build Coastguard Workerload("//build/make/core:product_config.rbc", "rblf") 16*9e94795aSAndroid Build Coastguard Workerload("//build/make/tests/input_variables.rbc", input_variables_init = "init") 17*9e94795aSAndroid Build Coastguard Workerload(":product.rbc", "init") 18*9e94795aSAndroid Build Coastguard Worker 19*9e94795aSAndroid Build Coastguard Workerdef assert_eq(expected, actual): 20*9e94795aSAndroid Build Coastguard Worker if expected != actual: 21*9e94795aSAndroid Build Coastguard Worker fail("Expected '%s', got '%s'" % (expected, actual)) 22*9e94795aSAndroid Build Coastguard Worker 23*9e94795aSAndroid Build Coastguard Workerdef test(): 24*9e94795aSAndroid Build Coastguard Worker (globals, globals_base) = rblf.product_configuration("test/product", init, input_variables_init) 25*9e94795aSAndroid Build Coastguard Worker assert_eq(["foo/bar/baz.txt:vendor/etc/baz.txt"], globals["PRODUCTS.test/product.mk.PRODUCT_COPY_FILES"]) 26*9e94795aSAndroid Build Coastguard Worker assert_eq(["foo/bar/baz.txt:vendor/etc/baz.txt"], globals["PRODUCTS.test/inherit2.mk.PRODUCT_COPY_FILES"]) 27*9e94795aSAndroid Build Coastguard Worker assert_eq(["foo/bar/baz.txt:vendor/etc/baz.txt"], globals["PRODUCTS.test/inherit3.mk.PRODUCT_COPY_FILES"]) 28