[libcxx-commits] [libcxx] a711b5e - [libc++] Add from-scratch configuration files for the test suite

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Sat Aug 29 13:54:13 PDT 2020


Author: Louis Dionne
Date: 2020-08-29T16:54:05-04:00
New Revision: a711b5eeb0e578c8af200860e31919aaecabca6d

URL: https://github.com/llvm/llvm-project/commit/a711b5eeb0e578c8af200860e31919aaecabca6d
DIFF: https://github.com/llvm/llvm-project/commit/a711b5eeb0e578c8af200860e31919aaecabca6d.diff

LOG: [libc++] Add from-scratch configuration files for the test suite

This commit adds the first from-scratch configuration files for running
the libc++ test suite without using the old configuration:

- libcxx-trunk-shared.cfg.py:
   Runs the test suite against a trunk libc++ shared library.
- libcxx-trunk-static.cfg.py:
   Runs the test suite against a trunk libc++ static library.

Differential Revision: https://reviews.llvm.org/D81866

Added: 
    libcxx/test/configs/libcxx-trunk-shared.cfg.in
    libcxx/test/configs/libcxx-trunk-static.cfg.in

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/libcxx/test/configs/libcxx-trunk-shared.cfg.in b/libcxx/test/configs/libcxx-trunk-shared.cfg.in
new file mode 100644
index 000000000000..c2ea900c680b
--- /dev/null
+++ b/libcxx/test/configs/libcxx-trunk-shared.cfg.in
@@ -0,0 +1,40 @@
+ at AUTO_GEN_COMMENT@
+
+LIBCXX_ROOT = "@LIBCXX_SOURCE_DIR@"
+INSTALL_ROOT = "@CMAKE_BINARY_DIR@"
+COMPILER = "@CMAKE_CXX_COMPILER@"
+EXEC_ROOT = "@LIBCXX_BINARY_DIR@"
+
+import os
+import pipes
+import site
+import sys
+site.addsitedir(os.path.join(LIBCXX_ROOT, 'utils'))
+import libcxx.test.features
+import libcxx.test.format
+import libcxx.test.newconfig
+import libcxx.test.params
+
+# Configure basic properties of the test suite
+config.name = 'libcxx-trunk-shared'
+config.test_source_root = os.path.join(LIBCXX_ROOT, 'test')
+config.test_format = libcxx.test.format.CxxStandardLibraryTest()
+config.recursiveExpansionLimit = 10
+config.test_exec_root = EXEC_ROOT
+
+# Configure basic substitutions
+runPy = os.path.join(LIBCXX_ROOT, 'utils', 'run.py')
+config.substitutions.append(('%{cxx}', COMPILER))
+config.substitutions.append(('%{flags}', ''))
+config.substitutions.append(('%{compile_flags}', '-nostdinc++ -isystem {} -I {}'.format(os.path.join(INSTALL_ROOT, 'include', 'c++', 'v1'),
+                                                                                        os.path.join(LIBCXX_ROOT, 'test', 'support'))))
+config.substitutions.append(('%{link_flags}', '-nostdlib++ -L {0} -lc++ -Wl,-rpath,{0}'.format(os.path.join(INSTALL_ROOT, 'lib'))))
+config.substitutions.append(('%{exec}', '{} {} --execdir %T -- '.format(pipes.quote(sys.executable), pipes.quote(runPy))))
+
+# Add parameters and features to the config
+libcxx.test.newconfig.configure(
+    libcxx.test.params.DEFAULT_PARAMETERS,
+    libcxx.test.features.DEFAULT_FEATURES,
+    config,
+    lit_config
+)

diff  --git a/libcxx/test/configs/libcxx-trunk-static.cfg.in b/libcxx/test/configs/libcxx-trunk-static.cfg.in
new file mode 100644
index 000000000000..11fba98f64f3
--- /dev/null
+++ b/libcxx/test/configs/libcxx-trunk-static.cfg.in
@@ -0,0 +1,41 @@
+ at AUTO_GEN_COMMENT@
+
+LIBCXX_ROOT = "@LIBCXX_SOURCE_DIR@"
+INSTALL_ROOT = "@CMAKE_BINARY_DIR@"
+COMPILER = "@CMAKE_CXX_COMPILER@"
+EXEC_ROOT = "@LIBCXX_BINARY_DIR@"
+
+import os
+import pipes
+import site
+import sys
+site.addsitedir(os.path.join(LIBCXX_ROOT, 'utils'))
+import libcxx.test.features
+import libcxx.test.format
+import libcxx.test.newconfig
+import libcxx.test.params
+
+# Configure basic properties of the test suite
+config.name = 'libcxx-trunk-static'
+config.test_source_root = os.path.join(LIBCXX_ROOT, 'test')
+config.test_format = libcxx.test.format.CxxStandardLibraryTest()
+config.recursiveExpansionLimit = 10
+config.test_exec_root = EXEC_ROOT
+
+# Configure basic substitutions
+runPy = os.path.join(LIBCXX_ROOT, 'utils', 'run.py')
+config.substitutions.append(('%{cxx}', COMPILER))
+config.substitutions.append(('%{flags}', ''))
+config.substitutions.append(('%{compile_flags}', '-nostdinc++ -isystem {} -I {}'.format(os.path.join(INSTALL_ROOT, 'include', 'c++', 'v1'),
+                                                                                        os.path.join(LIBCXX_ROOT, 'test', 'support'))))
+config.substitutions.append(('%{link_flags}', '-nostdlib++ {} {}'.format(os.path.join(INSTALL_ROOT, 'lib', 'libc++.a'),
+                                                                         os.path.join(INSTALL_ROOT, 'lib', 'libc++abi.a'))))
+config.substitutions.append(('%{exec}', '{} {} --execdir %T -- '.format(pipes.quote(sys.executable), pipes.quote(runPy))))
+
+# Add parameters and features to the config
+libcxx.test.newconfig.configure(
+    libcxx.test.params.DEFAULT_PARAMETERS,
+    libcxx.test.features.DEFAULT_FEATURES,
+    config,
+    lit_config
+)


        


More information about the libcxx-commits mailing list