xref: /llvm-project/libcxx/test/libcxx/module_std_compat.gen.py (revision 22f20564a8fc29ce6d3f5de075a2849ff8acb874)
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-exception
6#
7# ===----------------------------------------------------------------------===##
8
9# Test that all named declarations with external linkage match the
10# exported declarations in their associated module partition.
11# Then it tests the sum of the exported declarations in the module
12# partitions matches the export of the std.compat module.
13
14# Note the test of the std.compat module requires all partitions to be tested
15# first. Since lit tests have no dependencies, this means the test needs
16# to be one monolitic test. Since the test doesn't take very long it's
17# not a huge issue.
18
19# RUN: %{python} %s %{libcxx-dir}/utils
20
21import sys
22
23sys.path.append(sys.argv[1])
24from libcxx.header_information import module_c_headers
25from libcxx.test.modules import module_test_generator
26
27generator = module_test_generator(
28    "%t",
29    "%{module-dir}",
30    "%{clang-tidy}",
31    "%{test-tools-dir}/clang_tidy_checks/libcxx-tidy.plugin",
32    "%{cxx}",
33    "%{flags} %{compile_flags}",
34    "std.compat",
35)
36
37
38print("//--- module_std_compat.sh.cpp")
39generator.write_test(
40    "std.compat",
41    module_c_headers,
42)
43