[libc++] Add a script to automatize updating test for a new header.
Idea from D92525.
This script globs include/ directory and updates the tests in test/libcxx.
This patch does not generate module.modulemap nor CMakeLists.txt.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D92656
GitOrigin-RevId: 6fd5a94eeb9acca783549df26b2e6319df8ab0a8
diff --git a/docs/Contributing.rst b/docs/Contributing.rst
index abbf91f..f397f4c 100644
--- a/docs/Contributing.rst
+++ b/docs/Contributing.rst
@@ -23,18 +23,19 @@
2. Update the ``include/__libcpp_version`` file
3. Update the version number in ``docs/conf.py``
+Modifying feature test macros
+=============================
+
+When adding or updating feature test macros, you should update the corresponding tests.
+To do that, modify ``feature_test_macros`` table in the script ``utils/generate_feature_test_macro_components.py``, run it, and commit updated files.
+
Adding a new header TODO
========================
When adding a new header to libc++:
1. Add a test under ``test/libcxx`` that the new header defines ``_LIBCPP_VERSION``. See ``test/libcxx/algorithms/version.pass.cpp`` for an example.
-2. Update the following test files to include the new header:
-
- * ``test/libcxx/double_include.sh.cpp``
- * ``test/libcxx/min_max_macros.compile.pass.cpp``
- * ``test/libcxx/no_assert_include.compile.pass.cpp``
-
+2. Run ``python utils/generate_header_tests.py``, verify and commit the modifications.
3. Create a submodule in ``include/module.modulemap`` for the new header.
4. Update the ``include/CMakeLists.txt`` file to include the new header.