From 010c78598e8c1f18818da10c9f669800cc5f9cb0 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 22 Dec 2024 06:03:10 +0200 Subject: [PATCH] Split variant_index_type into separate runs for each variant size --- test/Jamfile | 11 +++++++++-- test/variant_index_type.cpp | 30 +++++++++++------------------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/test/Jamfile b/test/Jamfile index d99094e..537543c 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -144,9 +144,16 @@ compile variant_visit_cx.cpp : [ requires cxx14_constexpr ] ; compile variant_visit_cx_2.cpp : [ requires cxx14_constexpr ] ; compile variant_visit_r_cx.cpp : [ requires cxx14_constexpr ] ; -run variant_index_type.cpp : : : +local index-type-reqs = + release msvc,32:no - msvc-14.0:no # fails on GHA (only) with "out of heap space" clang,linux:-ftemplate-depth=1024 # for Clang 3.x ; + +local list-sizes = 126 127 128 129 254 255 256 257 ; + +for local list-size in $(list-sizes) +{ + run variant_index_type.cpp : : : $(index-type-reqs) LIST_SIZE=$(list-size) : variant_index_type_$(list-size) ; +} diff --git a/test/variant_index_type.cpp b/test/variant_index_type.cpp index ebe76b1..5e123ad 100644 --- a/test/variant_index_type.cpp +++ b/test/variant_index_type.cpp @@ -43,9 +43,11 @@ template struct W template using Wf = W< N::value >; -template class F, std::size_t N> void test_() +template class F> void test() { - using V = mp_rename< mp_transform>, boost::variant2::variant >; + using V = mp_rename< mp_transform, boost::variant2::variant >; + + constexpr std::size_t N = mp_size::value; using last_type = F>; @@ -63,32 +65,22 @@ template class F, std::size_t N> void test_() } } -template class F> void test() -{ - test_(); - test_(); - test_(); - test_(); - - test_(); - test_(); - test_(); - test_(); -} - int main() { + constexpr std::size_t N = LIST_SIZE; + using L = mp_iota_c; + static_assert( !boost::variant2::variant< X<0>, X<1> >::uses_double_storage(), "" ); - test(); + test(); static_assert( boost::variant2::variant< Y<0>, Y<1> >::uses_double_storage(), "" ); - test(); + test(); static_assert( !boost::variant2::variant< Z<0>, Z<1> >::uses_double_storage(), "" ); - test(); + test(); static_assert( boost::variant2::variant< W<0>, W<1> >::uses_double_storage(), "" ); - test(); + test(); return boost::report_errors(); }