From c0cd51bd2a3446556dd550f3337dbbe7b3e787ef Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Mon, 18 Sep 2023 11:45:35 -0700 Subject: [PATCH 1/6] Update test jamfile to glob for project headers and create self-include tests --- test/Jamfile.v2 | 24 ++++++++++++++++++++++++ test/unordered/self_include_tests.cpp | 11 +++++++++++ 2 files changed, 35 insertions(+) create mode 100644 test/unordered/self_include_tests.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 9313c7c1..893b6fa0 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -4,9 +4,13 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +import path ; +import regex ; import testing ; import ../../config/checks/config : requires ; +path-constant TOP : . ; + # Adding -Wundef is blocked on (at least) # https://github.com/boostorg/type_traits/issues/165 @@ -274,6 +278,25 @@ for local container in $(MMAP_CONTAINERS) } alias foa_mmap_tests : foa_mmap_$(MMAP_CONTAINERS)_tests ; + +local include_root = [ path.make $(TOP)/../include ] ; + +local headers = [ path.glob-tree $(include_root)/boost : *.hpp ] ; + +local paths ; +local sanitized_paths ; + +for local header in $(headers) +{ + local path = [ path.relative-to $(include_root) $(header) ] ; + local sanitized = [ regex.replace $(path) "[/.\\]" "_" ] ; + paths += $(path) ; + sanitized_paths += $(sanitized) ; + run unordered/self_include_tests.cpp : : : BOOST_UNORDERED_HEADER="$(path)" : foa_$(sanitized)_self_include_tests ; +} + +alias foa_self_include_tests : foa_$(sanitized_paths)_self_include_tests ; + alias foa_tests : foa_$(FOA_TESTS) foa_$(FOA_EXCEPTION_TESTS) @@ -281,6 +304,7 @@ alias foa_tests : foa_scoped_allocator foa_serialization_tests foa_mmap_tests + foa_self_include_tests ; local CFOA_TESTS = diff --git a/test/unordered/self_include_tests.cpp b/test/unordered/self_include_tests.cpp new file mode 100644 index 00000000..1ea410ab --- /dev/null +++ b/test/unordered/self_include_tests.cpp @@ -0,0 +1,11 @@ +#ifndef BOOST_UNORDERED_HEADER +#error "this requires a class template be passed as a macro" +#endif + +#define STRINGIZE(text) STRINGIZE_I(text) +#define STRINGIZE_I(...) #__VA_ARGS__ + +#define HEADER STRINGIZE(BOOST_UNORDERED_HEADER) +#include HEADER + +int main() {} From 85c7900339eac225a9767c670f53424dcd23fd1f Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Mon, 18 Sep 2023 11:45:45 -0700 Subject: [PATCH 2/6] Add missing element_type includes --- include/boost/unordered/detail/foa/node_map_types.hpp | 2 ++ include/boost/unordered/detail/foa/node_set_types.hpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/boost/unordered/detail/foa/node_map_types.hpp b/include/boost/unordered/detail/foa/node_map_types.hpp index 473d97d7..ccb378ef 100644 --- a/include/boost/unordered/detail/foa/node_map_types.hpp +++ b/include/boost/unordered/detail/foa/node_map_types.hpp @@ -5,6 +5,8 @@ #ifndef BOOST_UNORDERED_DETAIL_FOA_NODE_MAP_TYPES_HPP #define BOOST_UNORDERED_DETAIL_FOA_NODE_MAP_TYPES_HPP +#include + #include #include #include diff --git a/include/boost/unordered/detail/foa/node_set_types.hpp b/include/boost/unordered/detail/foa/node_set_types.hpp index 4d01d2fe..710ac6cc 100644 --- a/include/boost/unordered/detail/foa/node_set_types.hpp +++ b/include/boost/unordered/detail/foa/node_set_types.hpp @@ -5,6 +5,8 @@ #ifndef BOOST_UNORDERED_DETAIL_FOA_NODE_SET_TYPES_HPP #define BOOST_UNORDERED_DETAIL_FOA_NODE_SET_TYPES_HPP +#include + #include #include #include From 6f0a7155419e452298dd1f03c80ef1536a1ecc38 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Mon, 18 Sep 2023 15:32:48 -0700 Subject: [PATCH 3/6] Update drone.bat to abbreviate paths Our generated executable names exceed the MAX_PATH length Win32 imposes --- .drone/drone.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone/drone.bat b/.drone/drone.bat index 66aaf78d..3f874adf 100644 --- a/.drone/drone.bat +++ b/.drone/drone.bat @@ -20,4 +20,4 @@ b2 -d0 headers if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD% if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD% -b2 -j3 libs/%LIBRARY%/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release embed-manifest-via=linker +b2 --abbreviate-paths -j3 libs/%LIBRARY%/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release embed-manifest-via=linker From 7b24cf6607dc96fbf260f955101e61a5053a34ad Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Tue, 19 Sep 2023 08:50:03 -0700 Subject: [PATCH 4/6] Cleanup self-include tests to `compile` solely as object files --- test/Jamfile.v2 | 37 ++++++++++--------- ...e_tests.cpp => self_include_tests_obj.cpp} | 4 +- 2 files changed, 20 insertions(+), 21 deletions(-) rename test/unordered/{self_include_tests.cpp => self_include_tests_obj.cpp} (70%) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 893b6fa0..1ab8ba6f 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -56,6 +56,25 @@ path-constant BOOST_UNORDERED_TEST_DIR : . ; run quick.cpp ; +local include_root = [ path.make $(TOP)/../include ] ; + +local headers = [ path.glob-tree $(include_root)/boost : *.hpp ] ; + +local paths ; +local sanitized_paths ; + +for local header in $(headers) +{ + local path = [ path.relative-to $(include_root) $(header) ] ; + local sanitized = [ regex.replace $(path) "[/.\\]" "_" ] ; + paths += $(path) ; + sanitized_paths += $(sanitized) ; + compile unordered/self_include_tests_obj.cpp + : BOOST_UNORDERED_HEADER="$(path)" : foa_$(sanitized)_self_include_tests ; +} + +alias foa_self_include_tests : foa_$(sanitized_paths)_self_include_tests ; + local FCA_TESTS = allocator_traits assign_tests @@ -279,24 +298,6 @@ for local container in $(MMAP_CONTAINERS) alias foa_mmap_tests : foa_mmap_$(MMAP_CONTAINERS)_tests ; -local include_root = [ path.make $(TOP)/../include ] ; - -local headers = [ path.glob-tree $(include_root)/boost : *.hpp ] ; - -local paths ; -local sanitized_paths ; - -for local header in $(headers) -{ - local path = [ path.relative-to $(include_root) $(header) ] ; - local sanitized = [ regex.replace $(path) "[/.\\]" "_" ] ; - paths += $(path) ; - sanitized_paths += $(sanitized) ; - run unordered/self_include_tests.cpp : : : BOOST_UNORDERED_HEADER="$(path)" : foa_$(sanitized)_self_include_tests ; -} - -alias foa_self_include_tests : foa_$(sanitized_paths)_self_include_tests ; - alias foa_tests : foa_$(FOA_TESTS) foa_$(FOA_EXCEPTION_TESTS) diff --git a/test/unordered/self_include_tests.cpp b/test/unordered/self_include_tests_obj.cpp similarity index 70% rename from test/unordered/self_include_tests.cpp rename to test/unordered/self_include_tests_obj.cpp index 1ea410ab..420dc3a9 100644 --- a/test/unordered/self_include_tests.cpp +++ b/test/unordered/self_include_tests_obj.cpp @@ -1,5 +1,5 @@ #ifndef BOOST_UNORDERED_HEADER -#error "this requires a class template be passed as a macro" +#error "this test requires a class template be passed as a macro" #endif #define STRINGIZE(text) STRINGIZE_I(text) @@ -7,5 +7,3 @@ #define HEADER STRINGIZE(BOOST_UNORDERED_HEADER) #include HEADER - -int main() {} From 695301487416b9a04ecc738ac88795462af289fa Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Tue, 19 Sep 2023 11:42:23 -0700 Subject: [PATCH 5/6] Update self-include tests to use a significantly shorter mangling scheme for msvc targets --- test/Jamfile.v2 | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 1ab8ba6f..9ee04f10 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -56,9 +56,16 @@ path-constant BOOST_UNORDERED_TEST_DIR : . ; run quick.cpp ; -local include_root = [ path.make $(TOP)/../include ] ; +compile unordered/self_include_tests_obj.cpp + : BOOST_UNORDERED_HEADER="boost/unordered_map.hpp" + : tl_unordered_map_include_tests ; -local headers = [ path.glob-tree $(include_root)/boost : *.hpp ] ; +compile unordered/self_include_tests_obj.cpp + : BOOST_UNORDERED_HEADER="boost/unordered_set.hpp" + : tl_unordered_set_include_tests ; + +local include_root = [ path.make $(TOP)/../include ] ; +local headers = [ path.glob-tree $(include_root)/boost/unordered : *.hpp ] ; local paths ; local sanitized_paths ; @@ -66,14 +73,22 @@ local sanitized_paths ; for local header in $(headers) { local path = [ path.relative-to $(include_root) $(header) ] ; - local sanitized = [ regex.replace $(path) "[/.\\]" "_" ] ; + + local sanitized = [ path.relative-to "$(include_root)/boost/unordered" $(header) ] ; + sanitized = [ regex.replace $(sanitized) ".hpp" "" ] ; + sanitized = [ regex.replace $(sanitized) "[/.\\]" "_" ] ; + paths += $(path) ; sanitized_paths += $(sanitized) ; + compile unordered/self_include_tests_obj.cpp - : BOOST_UNORDERED_HEADER="$(path)" : foa_$(sanitized)_self_include_tests ; + : BOOST_UNORDERED_HEADER="$(path)" : $(sanitized)_include_tests ; } -alias foa_self_include_tests : foa_$(sanitized_paths)_self_include_tests ; +alias include_tests + : tl_unordered_map_include_tests + tl_unordered_set_include_tests + $(sanitized_paths)_include_tests ; local FCA_TESTS = allocator_traits @@ -305,7 +320,6 @@ alias foa_tests : foa_scoped_allocator foa_serialization_tests foa_mmap_tests - foa_self_include_tests ; local CFOA_TESTS = From 08187c7a1f7d34962c65150403e2420775373c51 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Tue, 19 Sep 2023 12:27:19 -0700 Subject: [PATCH 6/6] Swap _include_tests suffix for _hpp --- test/Jamfile.v2 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 9ee04f10..93a28ca6 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -58,11 +58,11 @@ run quick.cpp ; compile unordered/self_include_tests_obj.cpp : BOOST_UNORDERED_HEADER="boost/unordered_map.hpp" - : tl_unordered_map_include_tests ; + : tl_unordered_map_hpp ; compile unordered/self_include_tests_obj.cpp : BOOST_UNORDERED_HEADER="boost/unordered_set.hpp" - : tl_unordered_set_include_tests ; + : tl_unordered_set_hpp ; local include_root = [ path.make $(TOP)/../include ] ; local headers = [ path.glob-tree $(include_root)/boost/unordered : *.hpp ] ; @@ -75,20 +75,19 @@ for local header in $(headers) local path = [ path.relative-to $(include_root) $(header) ] ; local sanitized = [ path.relative-to "$(include_root)/boost/unordered" $(header) ] ; - sanitized = [ regex.replace $(sanitized) ".hpp" "" ] ; sanitized = [ regex.replace $(sanitized) "[/.\\]" "_" ] ; paths += $(path) ; sanitized_paths += $(sanitized) ; compile unordered/self_include_tests_obj.cpp - : BOOST_UNORDERED_HEADER="$(path)" : $(sanitized)_include_tests ; + : BOOST_UNORDERED_HEADER="$(path)" : $(sanitized) ; } alias include_tests - : tl_unordered_map_include_tests - tl_unordered_set_include_tests - $(sanitized_paths)_include_tests ; + : tl_unordered_map_hpp + tl_unordered_set_hpp + $(sanitized_paths) ; local FCA_TESTS = allocator_traits