def gather_tests(libs, selected_tests):
    tests = []
    for lib in libs:
        for filepath in sorted(glob.iglob(os.path.join('bench', lib, '*'))):
            (test, _) = os.path.splitext(os.path.basename(filepath))
            if ((test in tests) or (selected_tests and (test not in selected_tests))):
                continue
            tests.append(test)
    return tests
def gather_tests(libs, selected_tests):
    tests = []
    for lib in libs:
        for filepath in sorted(glob.iglob(os.path.join('bench', lib, '*'))):
            (test, _) = os.path.splitext(os.path.basename(filepath))
            if ((test in tests) or (selected_tests and (test not in selected_tests))):
                continue
            tests.append(test)
    return tests