summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2019-02-02 23:13:49 +0000
committerEric Fiselier <eric@efcs.ca>2019-02-02 23:13:49 +0000
commit23b5c8797f8654a82662ca17e726c3df3ee7aa84 (patch)
tree9828b835c4d20b774bedb2154125ee3fbf12b271
parent6146dbd36708c6724669f4d918d7d1e3f88eb3c3 (diff)
downloadlibcxx-23b5c8797f8654a82662ca17e726c3df3ee7aa84.tar.gz
Move the feature test macros script to the utils directory.
It doesn't make a lot of sense to keep it with the tests, deep into the test suite directonies. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@352970 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--docs/DesignDocs/FeatureTestMacros.rst9
-rwxr-xr-xutils/generate_feature_test_macro_components.py (renamed from test/std/language.support/support.limits/support.limits.general/generate_feature_test_macro_components.py)19
2 files changed, 15 insertions, 13 deletions
diff --git a/docs/DesignDocs/FeatureTestMacros.rst b/docs/DesignDocs/FeatureTestMacros.rst
index d55af96c6..2fbba6547 100644
--- a/docs/DesignDocs/FeatureTestMacros.rst
+++ b/docs/DesignDocs/FeatureTestMacros.rst
@@ -9,7 +9,9 @@ Overview
========
Libc++ implements the C++ feature test macros as specified in the C++2a standard,
-and before that in non-normative guiding documents (`See cppreference <https://en.cppreference.com/w/User:D41D8CD98F/feature_testing_macros>`)
+and before that in non-normative guiding documents
+(`See cppreference <https://en.cppreference.com/w/User:D41D8CD98F/feature_testing_macros>`_)
+
Design
======
@@ -23,8 +25,7 @@ lives in, and whether or not is is implemented by libc++. From this SSoA we
have enough information to automatically generate the `<version>` header,
the tests, and the documentation.
-Therefore we maintain a SSoA in
-`libcxx/test/std/language.support/support.limits/support.limits.general/generate_feature_test_macro_components.py`
+Therefore we maintain a SSoA in `libcxx/utils/generate_feature_test_macro_components.py`
which doubles as a script to generate the following components:
* The `<version>` header.
@@ -41,4 +42,4 @@ Whenever a feature test macro is added or changed, the table should be updated
and the script should be re-ran. The script will clobber the existing test files
and the documentation and it will generate a new `<version>` header as a
temporary file. The generated `<version>` header should be merged with the
-existing one. \ No newline at end of file
+existing one.
diff --git a/test/std/language.support/support.limits/support.limits.general/generate_feature_test_macro_components.py b/utils/generate_feature_test_macro_components.py
index 00b63d5eb..2bd80a858 100755
--- a/test/std/language.support/support.limits/support.limits.general/generate_feature_test_macro_components.py
+++ b/utils/generate_feature_test_macro_components.py
@@ -4,21 +4,22 @@ import os
import tempfile
def get_libcxx_paths():
- script_path = os.path.dirname(os.path.abspath(__file__))
+ utils_path = os.path.dirname(os.path.abspath(__file__))
script_name = os.path.basename(__file__)
- assert os.path.exists(script_path)
- depth = 5
- src_root = script_path
- for _ in xrange(0, 5):
- src_root = os.path.dirname(src_root)
+ assert os.path.exists(utils_path)
+ src_root = os.path.dirname(utils_path)
include_path = os.path.join(src_root, 'include')
assert os.path.exists(include_path)
docs_path = os.path.join(src_root, 'docs')
assert os.path.exists(docs_path)
- return script_path, script_name, src_root, include_path, docs_path
+ macro_test_path = os.path.join(src_root, 'test', 'std', 'language.support',
+ 'support.limits', 'support.limits.general')
+ assert os.path.exists(macro_test_path)
+ assert os.path.exists(os.path.join(macro_test_path, 'version.version.pass.cpp'))
+ return script_name, src_root, include_path, docs_path, macro_test_path
-script_path, script_name, source_root, include_path, docs_path = get_libcxx_paths()
+script_name, source_root, include_path, docs_path, macro_test_path = get_libcxx_paths()
def has_header(h):
h_path = os.path.join(include_path, h)
@@ -874,7 +875,7 @@ int main() {{}}
cxx17_tests=generate_std_test(test_list, 'c++17').strip(),
cxx2a_tests=generate_std_test(test_list, 'c++2a').strip())
test_name = "{header}.version.pass.cpp".format(header=h)
- out_path = os.path.join(script_path, test_name)
+ out_path = os.path.join(macro_test_path, test_name)
with open(out_path, 'w') as f:
f.write(test_body)