[libc++] Add an initial modulemap for the test support headers (#162800)

This should improve the time it takes to run the test suite a bit. Right
now there are only a handful of headers in the modulemap because we're
missing a lot of includes in the tests. New headers should be added
there from the start, and we should fill up the modulemap over time
until it contains all the test support headers.
This commit is contained in:
Nikolas Klauser 2025-11-13 09:28:48 +01:00 committed by GitHub
parent 478e45fb94
commit 189d1853e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
53 changed files with 103 additions and 32 deletions

View file

@ -2361,7 +2361,10 @@ module std [system] {
module hash_table { header "__hash_table" }
module node_handle { header "__node_handle" }
module split_buffer { header "__split_buffer" }
module tree { header "__tree" }
module tree {
header "__tree"
export std.memory.unique_ptr
}
module std_mbstate_t {
header "__std_mbstate_t.h"
export *

View file

@ -19,6 +19,7 @@
#include <cstdint>
#include <iterator>
#include <type_traits>
#include <utility>
#include "test_iterators.h"

View file

@ -17,6 +17,8 @@
#include <__memory/allocation_guard.h>
#include <cassert>
#include <climits>
#include <memory>
#include <type_traits>
#include <utility>

View file

@ -11,6 +11,7 @@
// ensure that __uninitialized_allocator_copy calls the proper construct and destruct functions
#include <algorithm>
#include <cassert>
#include <iterator>
#include <memory>

View file

@ -32,6 +32,7 @@
#include "almost_satisfies_types.h"
#include "test_iterators.h"
#include "type_algorithms.h"
struct NotEqualityComparable {};

View file

@ -19,6 +19,7 @@
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <vector>
#include "sized_allocator.h"

View file

@ -26,6 +26,7 @@
#include <array>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <ranges>
#include <vector>

View file

@ -25,8 +25,10 @@
#include <array>
#include <chrono>
#include <ranges>
#include "almost_satisfies_types.h"
#include "test_iterators.h"
#include "type_algorithms.h"
using namespace std::chrono;

View file

@ -27,6 +27,7 @@
#include "almost_satisfies_types.h"
#include "test_iterators.h"
#include "type_algorithms.h"
template <class Iter1, class Sent1 = Iter1, class Iter2 = int*, class Sent2 = Iter2>
concept HasStartsWithIt = requires(Iter1 first1, Sent1 last1, Iter2 first2, Sent2 last2) {

View file

@ -20,6 +20,7 @@
#include "test_iterators.h"
#include "test_execution_policies.h"
#include "type_algorithms.h"
template <class Iter>
struct Test {

View file

@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
#include <map>
#include <cassert>
#include <map>
#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"

View file

@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
#include <map>
#include <cassert>
#include <map>
#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"

View file

@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
#include <set>
#include <cassert>
#include <set>
#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"

View file

@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
#include <set>
#include <cassert>
#include <set>
#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"

View file

@ -12,6 +12,7 @@
// flat_map& operator=(const flat_map& m);
#include <cassert>
#include <deque>
#include <flat_map>
#include <functional>

View file

@ -17,6 +17,7 @@
#include <flat_map>
#include <functional>
#include <vector>
#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"

View file

@ -15,6 +15,7 @@
#include <vector>
#include <flat_map>
#include <ranges>
#include <type_traits>
#include "../flat_helpers.h"
#include "test_allocator.h"

View file

@ -12,6 +12,7 @@
// flat_multimap& operator=(const flat_multimap& m);
#include <cassert>
#include <deque>
#include <flat_map>
#include <functional>

View file

@ -16,6 +16,7 @@
#include <deque>
#include <flat_map>
#include <functional>
#include <type_traits>
#include <vector>
#include "test_macros.h"

View file

@ -15,6 +15,7 @@
#include <vector>
#include <flat_map>
#include <ranges>
#include <type_traits>
#include "../flat_helpers.h"
#include "test_allocator.h"

View file

@ -14,6 +14,7 @@
// template <class Alloc>
// flat_multiset(const key_compare& comp, const Alloc& a);
#include <cassert>
#include <deque>
#include <flat_set>
#include <functional>

View file

@ -13,9 +13,11 @@
// flat_multiset& operator=(const flat_multiset& m);
#include <algorithm>
#include <cassert>
#include <deque>
#include <flat_set>
#include <functional>
#include <utility>
#include <vector>
#include "operator_hijacker.h"

View file

@ -16,6 +16,7 @@
#include <deque>
#include <flat_set>
#include <functional>
#include <type_traits>
#include <vector>
#include "test_macros.h"

View file

@ -13,6 +13,7 @@
// flat_set& operator=(const flat_set& m);
#include <algorithm>
#include <cassert>
#include <deque>
#include <flat_set>
#include <functional>

View file

@ -16,6 +16,7 @@
#include <deque>
#include <flat_set>
#include <functional>
#include <type_traits>
#include <vector>
#include "test_macros.h"

View file

@ -15,6 +15,7 @@
#include <cassert>
#include <stack>
#include <type_traits>
#include "test_allocator.h"

View file

@ -13,6 +13,7 @@
// belonging to the container being moved. Such move construction of the
// allocator shall not exit via an exception.
#include <cassert>
#include <vector>
#include <deque>
#include <list>

View file

@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
#include <deque>
#include <cassert>
#include <deque>
#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"

View file

@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
#include <forward_list>
#include <cassert>
#include <forward_list>
#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"

View file

@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
#include <list>
#include <cassert>
#include <list>
#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"

View file

@ -14,6 +14,7 @@
// vector& operator=(vector&& c);
#include <cassert>
#include <utility>
#include <vector>
#include "min_allocator.h"

View file

@ -16,8 +16,9 @@
// For vector<>, this was added to the standard by N4258,
// but vector<bool> was not changed.
#include <vector>
#include <cassert>
#include <vector>
#include <type_traits>
#include "test_macros.h"
#include "test_allocator.h"

View file

@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
#include <vector>
#include <cassert>
#include <vector>
#include <type_traits>
#include "test_macros.h"
#include "test_allocator.h"

View file

@ -17,8 +17,9 @@
// UNSUPPORTED: c++03
#include <vector>
#include <cassert>
#include <vector>
#include <type_traits>
#include "test_macros.h"
#include "test_allocator.h"

View file

@ -15,8 +15,9 @@
// UNSUPPORTED: c++03
#include <vector>
#include <cassert>
#include <vector>
#include <type_traits>
#include "test_macros.h"
#include "test_allocator.h"

View file

@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
#include <vector>
#include <cassert>
#include <vector>
#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"

View file

@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
#include <unordered_map>
#include <cassert>
#include <unordered_map>
#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"

View file

@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
#include <unordered_map>
#include <cassert>
#include <unordered_map>
#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"

View file

@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
#include <unordered_set>
#include <cassert>
#include <unordered_set>
#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"

View file

@ -12,8 +12,9 @@
// UNSUPPORTED: c++03
#include <unordered_set>
#include <cassert>
#include <unordered_set>
#include <type_traits>
#include "test_macros.h"
#include "MoveOnly.h"

View file

@ -32,6 +32,7 @@
#include <type_traits>
#include <string_view>
#include <cassert>
#include <utility>
// On Windows, the append function converts all inputs (pointers, iterators)
// to an intermediate path object, causing allocations in cases where no

View file

@ -39,6 +39,7 @@
#include <string>
#include <string_view>
#include <cassert>
#include <utility>
// On Windows, charset conversions cause allocations in the path class in
// cases where no allocations are done on other platforms.

View file

@ -20,6 +20,7 @@
#include <cassert>
#include <cmath>
#include <limits>
#include <type_traits>
#include "test_macros.h"
#include "type_algorithms.h"

View file

@ -12,6 +12,9 @@
// inline constexpr unspecified indices = unspecified;
// FIXME: This test shouldn't define TEST_HAS_NO_INT128
// ADDITIONAL_COMPILE_FLAGS(clang-modules-build): -fno-modules
#include <cassert>
#include <cstddef>
#include <ranges>

View file

@ -14,8 +14,10 @@
//
// Additionally, the stored Allocator value is move constructed from m.get_allocator().
#include <regex>
#include <cassert>
#include <regex>
#include <utility>
#include "test_macros.h"
#include "test_allocator.h"

View file

@ -12,11 +12,12 @@
// ~basic_string() // implied noexcept; // constexpr since C++20
#include <string>
#include <cassert>
#include <string>
#include <type_traits>
#include "test_macros.h"
#include "test_allocator.h"
#include "test_macros.h"
template <class T>
struct throwing_alloc {

View file

@ -25,6 +25,7 @@
#include <iterator>
#include <string>
#include <type_traits>
#include <utility>
#include "test_macros.h"
#include "test_allocator.h"

View file

@ -19,17 +19,18 @@
// The deduction guide shall not participate in overload resolution if Allocator
// is a type that does not qualify as an allocator.
#include <string>
#include <string_view>
#include <iterator>
#include <memory>
#include <type_traits>
#include <cassert>
#include <cstddef>
#include <iterator>
#include <memory>
#include <string>
#include <string_view>
#include <type_traits>
#include <utility>
#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
#include "test_allocator.h"
#include "test_macros.h"
template <class StringView, class Allocator, class = void>
struct CanDeduce : std::false_type {};

View file

@ -25,15 +25,16 @@
// The deduction guide shall not participate in overload resolution if Allocator
// is a type that does not qualify as an allocator.
#include <string>
#include <string_view>
#include <iterator>
#include <cassert>
#include <cstddef>
#include <iterator>
#include <string>
#include <string_view>
#include <utility>
#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
#include "test_allocator.h"
#include "test_macros.h"
template <class StringView, class Size, class Allocator, class = void>
struct CanDeduce : std::false_type {};

View file

@ -14,6 +14,7 @@
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
#include <cassert>
#include <concepts>
#include <memory>
#include <tuple>

View file

@ -14,6 +14,7 @@
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
#include <cassert>
#include <concepts>
#include <memory>
#include <tuple>

View file

@ -14,10 +14,12 @@
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
#include <cassert>
#include <concepts>
#include <memory>
#include <ranges>
#include <tuple>
#include <type_traits>
#include <utility>
#include "common.h"

View file

@ -0,0 +1,10 @@
module test_config {
module test_macros { textual header "test_macros.h" }
}
module test {
module double_move_tracker { header "double_move_tracker.h" }
module test_allocator { header "test_allocator.h" }
module type_algorithms { header "type_algorithms.h" }
}