mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-29 19:07:15 +02:00
Merge pull request #213 from cmazakas/self-include-tests
self-include tests
This commit is contained in:
@ -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
|
||||
|
@ -5,6 +5,8 @@
|
||||
#ifndef BOOST_UNORDERED_DETAIL_FOA_NODE_MAP_TYPES_HPP
|
||||
#define BOOST_UNORDERED_DETAIL_FOA_NODE_MAP_TYPES_HPP
|
||||
|
||||
#include <boost/unordered/detail/foa/element_type.hpp>
|
||||
|
||||
#include <boost/core/allocator_access.hpp>
|
||||
#include <boost/core/no_exceptions_support.hpp>
|
||||
#include <boost/core/pointer_traits.hpp>
|
||||
|
@ -5,6 +5,8 @@
|
||||
#ifndef BOOST_UNORDERED_DETAIL_FOA_NODE_SET_TYPES_HPP
|
||||
#define BOOST_UNORDERED_DETAIL_FOA_NODE_SET_TYPES_HPP
|
||||
|
||||
#include <boost/unordered/detail/foa/element_type.hpp>
|
||||
|
||||
#include <boost/core/allocator_access.hpp>
|
||||
#include <boost/core/no_exceptions_support.hpp>
|
||||
#include <boost/core/pointer_traits.hpp>
|
||||
|
@ -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
|
||||
|
||||
@ -52,6 +56,39 @@ path-constant BOOST_UNORDERED_TEST_DIR : . ;
|
||||
|
||||
run quick.cpp ;
|
||||
|
||||
compile unordered/self_include_tests_obj.cpp
|
||||
: <define>BOOST_UNORDERED_HEADER="boost/unordered_map.hpp"
|
||||
: tl_unordered_map_hpp ;
|
||||
|
||||
compile unordered/self_include_tests_obj.cpp
|
||||
: <define>BOOST_UNORDERED_HEADER="boost/unordered_set.hpp"
|
||||
: tl_unordered_set_hpp ;
|
||||
|
||||
local include_root = [ path.make $(TOP)/../include ] ;
|
||||
local headers = [ path.glob-tree $(include_root)/boost/unordered : *.hpp ] ;
|
||||
|
||||
local paths ;
|
||||
local sanitized_paths ;
|
||||
|
||||
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) "[/.\\]" "_" ] ;
|
||||
|
||||
paths += $(path) ;
|
||||
sanitized_paths += $(sanitized) ;
|
||||
|
||||
compile unordered/self_include_tests_obj.cpp
|
||||
: <define>BOOST_UNORDERED_HEADER="$(path)" : $(sanitized) ;
|
||||
}
|
||||
|
||||
alias include_tests
|
||||
: tl_unordered_map_hpp
|
||||
tl_unordered_set_hpp
|
||||
$(sanitized_paths) ;
|
||||
|
||||
local FCA_TESTS =
|
||||
allocator_traits
|
||||
assign_tests
|
||||
@ -274,6 +311,7 @@ for local container in $(MMAP_CONTAINERS)
|
||||
}
|
||||
|
||||
alias foa_mmap_tests : foa_mmap_$(MMAP_CONTAINERS)_tests ;
|
||||
|
||||
alias foa_tests :
|
||||
foa_$(FOA_TESTS)
|
||||
foa_$(FOA_EXCEPTION_TESTS)
|
||||
|
9
test/unordered/self_include_tests_obj.cpp
Normal file
9
test/unordered/self_include_tests_obj.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef BOOST_UNORDERED_HEADER
|
||||
#error "this test 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
|
Reference in New Issue
Block a user