Skip to content

Commit 00cf2e7

Browse files
committed
[libc++] Implements the new FTM header test generator.
This generator has almost identical output to the existing script. Notable differences are - conditionally include not yet implemented headers - removes the synopsis - uses 2 spaces indent in `# if` There are a few more test macros added that triggered bugs in existing FTM.
1 parent 72954e1 commit 00cf2e7

10 files changed

+1092
-17
lines changed

libcxx/test/libcxx/feature_test_macro/ftm_metadata.sh.py

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,52 @@ def setUp(self):
2727
def test_implementation(self):
2828
expected = {
2929
"__cpp_lib_any": Metadata(
30-
headers=["any"], test_suite_guard=None, libcxx_guard=None
30+
headers=["any"],
31+
available_since="c++17",
32+
test_suite_guard=None,
33+
libcxx_guard=None,
3134
),
3235
"__cpp_lib_barrier": Metadata(
3336
headers=["barrier"],
37+
available_since="c++20",
3438
test_suite_guard="!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)",
3539
libcxx_guard="_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC",
3640
),
41+
"__cpp_lib_clamp": Metadata(
42+
headers=["algorithm"],
43+
available_since="c++17",
44+
test_suite_guard=None,
45+
libcxx_guard=None,
46+
),
3747
"__cpp_lib_format": Metadata(
38-
headers=["format"], test_suite_guard=None, libcxx_guard=None
48+
headers=["format"],
49+
available_since="c++20",
50+
test_suite_guard=None,
51+
libcxx_guard=None,
3952
),
4053
"__cpp_lib_parallel_algorithm": Metadata(
4154
headers=["algorithm", "numeric"],
55+
available_since="c++17",
56+
test_suite_guard=None,
57+
libcxx_guard=None,
58+
),
59+
"__cpp_lib_to_chars": Metadata(
60+
headers=["charconv"],
61+
available_since="c++17",
4262
test_suite_guard=None,
4363
libcxx_guard=None,
4464
),
4565
"__cpp_lib_variant": Metadata(
46-
headers=["variant"], test_suite_guard=None, libcxx_guard=None
66+
headers=["variant"],
67+
available_since="c++17",
68+
test_suite_guard=None,
69+
libcxx_guard=None,
4770
),
48-
"__cpp_lib_missing_FTM_in_older_standard": Metadata(
49-
headers=[], test_suite_guard=None, libcxx_guard=None
71+
"__cpp_lib_zz_missing_FTM_in_older_standard": Metadata(
72+
headers=[],
73+
available_since="c++17",
74+
test_suite_guard=None,
75+
libcxx_guard=None,
5076
),
5177
}
5278
self.assertEqual(self.ftm.ftm_metadata, expected)

0 commit comments

Comments
 (0)