brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 5926f52 Raw
37 lines · python
1# ===----------------------------------------------------------------------===##2#3# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4# See https://llvm.org/LICENSE.txt for license information.5# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6#7# ===----------------------------------------------------------------------===##8 9# Run our custom libc++ clang-tidy checks on all public headers.10 11# REQUIRES: has-clang-tidy12 13# The frozen headers should not be updated to the latest libc++ style, so don't test.14# UNSUPPORTED: FROZEN-CXX03-HEADERS-FIXME15 16# The GCC compiler flags are not always compatible with clang-tidy.17# UNSUPPORTED: gcc18 19# RUN: %{python} %s %{libcxx-dir}/utils20# END.21 22import sys23sys.path.append(sys.argv[1])24from libcxx.header_information import lit_header_restrictions, lit_header_undeprecations, public_headers25 26for header in public_headers:27  print(f"""\28//--- {header}.sh.cpp29{lit_header_restrictions.get(header, '')}30{lit_header_undeprecations.get(header, '')}31 32// TODO: run clang-tidy with modules enabled once they are supported33// RUN: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --config-file=%{{libcxx-dir}}/.clang-tidy --load=%{{test-tools-dir}}/clang_tidy_checks/libcxx-tidy.plugin -- -Wweak-vtables %{{compile_flags}} -fno-modules34 35#include <{header}>36""")37