From 2223adafd748dec32a8c505d4aecb3f811f964cb Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Wed, 4 Sep 2024 13:47:55 -0400 Subject: [PATCH] [libc++] Split the module_std and module_std_compat tests 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. --- libcxx/test/libcxx/module_std.gen.py | 2 -- libcxx/test/libcxx/module_std_compat.gen.py | 2 -- libcxx/utils/libcxx/test/modules.py | 10 +++++----- 3 files changed, 5 insertions(+), 9 deletions(-) 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)