# Copyright 2023 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.

from importlib import resources
from pathlib import Path
import importlib
import sys
import tempfile
import unittest

tests = [
    'LL.CIS.CEN.BV_01_C',
    'LL.CIS.CEN.BV_03_C',
    'LL.CIS.CEN.BV_10_C',
    'LL.CIS.CEN.BV_26_C',
    'LL.CIS.PER.BV_01_C',
    'LL.CIS.PER.BV_02_C',
    'LL.CON_.CEN.BV_41_C',
    'LL.CON_.CEN.BV_43_C',
    'LL.CON_.INI.BV_08_C',
    'LL.CON_.INI.BV_09_C',
    'LL.CON_.INI.BV_10_C',
    'LL.CON_.INI.BV_11_C',
    'LL.CON_.PER.BV_40_C',
    'LL.CON_.PER.BV_42_C',
    'LL.DDI.ADV.BV_01_C',
    'LL.DDI.ADV.BV_02_C',
    'LL.DDI.ADV.BV_03_C',
    'LL.DDI.ADV.BV_04_C',
    'LL.DDI.ADV.BV_05_C',
    'LL.DDI.ADV.BV_06_C',
    'LL.DDI.ADV.BV_07_C',
    'LL.DDI.ADV.BV_08_C',
    'LL.DDI.ADV.BV_09_C',
    'LL.DDI.ADV.BV_11_C',
    'LL.DDI.ADV.BV_15_C',
    'LL.DDI.ADV.BV_16_C',
    'LL.DDI.ADV.BV_17_C',
    'LL.DDI.ADV.BV_18_C',
    'LL.DDI.ADV.BV_19_C',
    'LL.DDI.ADV.BV_20_C',
    'LL.DDI.ADV.BV_21_C',
    'LL.DDI.ADV.BV_22_C',
    'LL.DDI.ADV.BV_26_C',
    'LL.DDI.ADV.BV_47_C',
    'LL.DDI.SCN.BV_13_C',
    'LL.DDI.SCN.BV_14_C',
    'LL.DDI.SCN.BV_18_C',
    'LL.DDI.SCN.BV_19_C',
    'LL.DDI.SCN.BV_20_C',
    'LL.DDI.SCN.BV_79_C',
    'LL.SEC.ADV.BV_11_C',
    'LMP.LIH.BV_01_C',
    'LMP.LIH.BV_02_C',
    'LMP.LIH.BV_78_C',
    'LMP.LIH.BV_79_C',
    'LMP.LIH.BV_142_C',
    'LMP.LIH.BV_143_C',
    'LMP.LIH.BV_144_C',
    'LMP.LIH.BV_149_C',
    'LL.scan_collision',
    'LL.scan_timeout',
    'LMP.page_collision',
]


def include_test(test: str, patterns) -> bool:
    return not patterns or any(test.startswith(prefix) for prefix in patterns)


if __name__ == "__main__":
    suite = unittest.TestSuite()
    patterns = [arg for arg in sys.argv[1:] if not arg.startswith('-')]
    for test in tests:
        if include_test(test, patterns):
            module = importlib.import_module(f'test.{test}')
            suite.addTest(unittest.defaultTestLoader.loadTestsFromModule(module))
    unittest.TextTestRunner(verbosity=3).run(suite)
