# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


# Run test configuration and verify its result.
# The main configuration file is device.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
#  * all runtime functions (wildcard, regex, etc.) work

load("//build/make/core:product_config.rbc", "rblf")
load(":device.rbc", "init")

def assert_eq(expected, actual):
    if expected != actual:
        fail("Expected %s, got %s" % (expected, actual))

# Unit tests for non-trivial runtime functions
assert_eq("", rblf.mkstrip(" \n \t    "))
assert_eq("a b c", rblf.mkstrip("  a b   \n  c \t"))

assert_eq("b1 b2", rblf.mksubst("a", "b", "a1 a2"))
assert_eq(["b1", "x2"], rblf.mksubst("a", "b", ["a1", "x2"]))

assert_eq("ABcdYZ", rblf.mkpatsubst("ab%yz", "AB%YZ", "abcdyz"))
assert_eq("bcz", rblf.mkpatsubst("a%z", "A%Z", "bcz"))
assert_eq(["Ay", "Az"], rblf.mkpatsubst("a%", "A%", ["ay", "az"]))
assert_eq("AcZ bcz", rblf.mkpatsubst("a%z", "A%Z", "acz  bcz"))
assert_eq("Abcd", rblf.mkpatsubst("a%", "A%", "abcd"))
assert_eq("abcZ", rblf.mkpatsubst("%z", "%Z", "abcz"))
assert_eq("azx b", rblf.mkpatsubst("az", "AZ", "azx  b"))
assert_eq(["azx", "b"], rblf.mkpatsubst("az", "AZ", ["azx", "b"]))
assert_eq("ABC", rblf.mkpatsubst("abc", "ABC", "abc"))

globals, config = rblf.product_configuration("test/device", init)
assert_eq(
    {
      "PRODUCT_COPY_FILES": [
          "part_from:part_to",
          "device_from:device_to",
          "device/google/redfin/audio/audio_platform_info_noextcodec_snd.xml:||VENDOR-PATH-PH||/etc/audio_platform_info_noextcodec_snd.xml",
          "xyz:/etc/xyz",
          "x.xml:/etc/x.xml",
          "y.xml:/etc/y.xml",
      ],
      "PRODUCT_HOST_PACKAGES": ["host"],
      "PRODUCT_PACKAGES": [
          "dev",
          "inc",
          "dev_after"
      ],
      "PRODUCT_PRODUCT_PROPERTIES": ["part_properties"]
    },
    { k:v for k, v in sorted(config.items()) }
)

ns = globals["$SOONG_CONFIG_NAMESPACES"]
assert_eq(
    {
        "NS1": {
            "v1": "abc",
            "v2": "def"
        },
        "NS2": {
            "v3": "xyz"
        }
    },
    {k:v for k, v in sorted(ns.items()) }
)
