def extract_mapping(mapping, params):
    """get tests associated with a list of params from mapping"""
    data = {}
    selected_tests = []
    for p in params:
        if p in mapping:
            tests = mapping[p]
            print(">>>>[ctest_core] parameter {} has {} tests".format(p, len(tests)))
            data[p] = tests
            selected_tests = selected_tests + tests
        else:
            print(">>>>[ctest_core] parameter {} has 0 tests".format(p))
    return data, set(selected_tests)