[libcxx-commits] [libcxx] [libc++] Split the module_std and module_std_compat tests (PR #107275)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 4 10:55:56 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/107275.diff


3 Files Affected:

- (modified) libcxx/test/libcxx/module_std.gen.py (-2) 
- (modified) libcxx/test/libcxx/module_std_compat.gen.py (-2) 
- (modified) libcxx/utils/libcxx/test/modules.py (+5-5) 


``````````diff
diff --git a/libcxx/test/libcxx/module_std.gen.py b/libcxx/test/libcxx/module_std.gen.py
index fc23985caf30de..ea62df88151feb 100644
--- a/libcxx/test/libcxx/module_std.gen.py
+++ b/libcxx/test/libcxx/module_std.gen.py
@@ -33,6 +33,4 @@
     "std",
 )
 
-
-print("//--- module_std.sh.cpp")
 generator.write_test("std")
diff --git a/libcxx/test/libcxx/module_std_compat.gen.py b/libcxx/test/libcxx/module_std_compat.gen.py
index 000aa299861220..960cfd9b80b10e 100644
--- a/libcxx/test/libcxx/module_std_compat.gen.py
+++ b/libcxx/test/libcxx/module_std_compat.gen.py
@@ -34,8 +34,6 @@
     "std.compat",
 )
 
-
-print("//--- module_std_compat.sh.cpp")
 generator.write_test(
     "std.compat",
     module_c_headers,
diff --git a/libcxx/utils/libcxx/test/modules.py b/libcxx/utils/libcxx/test/modules.py
index b7758dc9a41ee8..67c433d3a5eede 100644
--- a/libcxx/utils/libcxx/test/modules.py
+++ b/libcxx/utils/libcxx/test/modules.py
@@ -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)

``````````

</details>


https://github.com/llvm/llvm-project/pull/107275


More information about the libcxx-commits mailing list