Skip to content

Commit

Permalink
[libc++] Split the module_std and module_std_compat tests
Browse files Browse the repository at this point in the history
The C++20 modules tests were set up such that the top-level gen-py
test would generate a single ShTest which would then run tests for
all the module parts.

However, gen-py tests were originally intended to generate multiple
smaller independent Lit tests that would be executed by Lit directly.
Doing so increases test suite parallelism, makes error messages easier
to understand and avoids nesting multiple layers of test generation,
which is confusing.

This patch modifies the C++20 modules test to generate individual
Lit tests instead.
  • Loading branch information
ldionne committed Sep 4, 2024
1 parent a724f9a commit 2223ada
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 0 additions & 2 deletions libcxx/test/libcxx/module_std.gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,4 @@
"std",
)


print("//--- module_std.sh.cpp")
generator.write_test("std")
2 changes: 0 additions & 2 deletions libcxx/test/libcxx/module_std_compat.gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
"std.compat",
)


print("//--- module_std_compat.sh.cpp")
generator.write_test(
"std.compat",
module_c_headers,
Expand Down
10 changes: 5 additions & 5 deletions libcxx/utils/libcxx/test/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,13 @@ def test_module(self, module):
)

def write_test(self, module, c_headers=[]):
self.write_lit_configuration()

# Validate all module parts.
for header in module_headers:
print(f"//--- {header}.sh.cpp")
self.write_lit_configuration()

is_c_header = header in c_headers
include = self.process_module_partition(header, is_c_header)
self.process_header(header, include, is_c_header)

self.process_module(module)
self.test_module(module)
self.process_module(module)
self.test_module(module)

0 comments on commit 2223ada

Please sign in to comment.