Skip to content

Commit ecab1e5

Browse files
committed
[libc++][WIP] Move the libc++ test format to Lit
This allows the generally-useful parts of the test format to be shipped alongside Lit, which would make it usable for third-party developers as well. This came up at C++Now in the context of the Beman project where we'd like to set up a non-LLVM project that can use the same testing framework as libc++. With the test format moved to Lit, the format would be available after installing Lit with pip, which is really convenient.
1 parent a00bbcb commit ecab1e5

File tree

7 files changed

+421
-366
lines changed

7 files changed

+421
-366
lines changed

libcxx/test/configs/cmake-bridge.cfg.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import libcxx.test.format
1818
# Basic configuration of the test suite
1919
config.name = os.path.basename('@LIBCXX_TEST_CONFIG@')
2020
config.test_source_root = os.path.join('@LIBCXX_SOURCE_DIR@', 'test')
21-
config.test_format = libcxx.test.format.CxxStandardLibraryTest()
21+
config.test_format = libcxx.test.format.LibcxxTest()
2222
config.recursiveExpansionLimit = 10
2323
config.test_exec_root = os.path.join('@CMAKE_BINARY_DIR@', 'test')
2424

libcxx/utils/libcxx/test/dsl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def _executeWithFakeConfig(test, commands):
9999
order="smart",
100100
params={},
101101
)
102-
return libcxx.test.format._executeScriptInternal(test, litConfig, commands)
102+
return lit.formats.standardlibrarytest._executeScriptInternal(test, litConfig, commands)
103103

104104

105105
def _makeConfigTest(config):
@@ -121,12 +121,12 @@ def _makeConfigTest(config):
121121

122122
class TestWrapper(lit.Test.Test):
123123
def __enter__(self):
124-
testDir, _ = libcxx.test.format._getTempPaths(self)
124+
testDir, _ = lit.formats.standardlibrarytest._getTempPaths(self)
125125
os.makedirs(testDir)
126126
return self
127127

128128
def __exit__(self, *args):
129-
testDir, _ = libcxx.test.format._getTempPaths(self)
129+
testDir, _ = lit.formats.standardlibrarytest._getTempPaths(self)
130130
shutil.rmtree(testDir)
131131
os.remove(tmp.name)
132132

0 commit comments

Comments
 (0)