Skip to content

Commit

Permalink
[libc++] Add a script to automatize updating test for a new header.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mkurdej committed Dec 10, 2020
1 parent e4a23a4 commit 6fd5a94
Show file tree
Hide file tree
Showing 5 changed files with 1,037 additions and 713 deletions.
13 changes: 7 additions & 6 deletions libcxx/docs/Contributing.rst
Expand Up @@ -23,18 +23,19 @@ After branching for an LLVM release:
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.

Expand Down

0 comments on commit 6fd5a94

Please sign in to comment.