diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 97b0edac..a71d3cb5 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -237,12 +237,35 @@ for local test in $(FOA_EXCEPTION_TESTS) run exception/$(test).cpp : : : BOOST_UNORDERED_FOA_TESTS : foa_$(test) ; } +local MMAP_CONTAINERS = + unordered_flat_map + unordered_flat_set + unordered_node_map + unordered_node_set + unordered_map + unordered_set + unordered_multimap + unordered_multiset + concurrent_flat_map +; + +for local container in $(MMAP_CONTAINERS) +{ + run unordered/mmap_tests.cpp /boost/filesystem//boost_filesystem : : + : BOOST_UNORDERED_FOA_MMAP_MAP_TYPE="boost::$(container)" + off + static + : foa_mmap_$(container)_tests ; +} + +alias foa_mmap_tests : foa_mmap_$(MMAP_CONTAINERS)_tests ; alias foa_tests : foa_$(FOA_TESTS) foa_$(FOA_EXCEPTION_TESTS) foa_link_test foa_scoped_allocator foa_serialization_tests + foa_mmap_tests ; local CFOA_TESTS = diff --git a/test/unordered/mmap_tests.cpp b/test/unordered/mmap_tests.cpp new file mode 100644 index 00000000..462b2eb5 --- /dev/null +++ b/test/unordered/mmap_tests.cpp @@ -0,0 +1,195 @@ +// Copyright 2023 Christian Mazakas. +// 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) + +#include + +#if defined(BOOST_CLANG_VERSION) && BOOST_CLANG_VERSION < 30900 +#include +BOOST_PRAGMA_MESSAGE( + "This version of clang is incompatible with Boost.Process"); +int main() {} +#else +#include "../helpers/test.hpp" + +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#ifndef BOOST_UNORDERED_FOA_MMAP_MAP_TYPE +#error "this requires a class template be passed as a macro" +#endif + +using char_allocator = boost::interprocess::allocator; + +using string_type = boost::interprocess::basic_string, char_allocator>; + +using pair_type = std::pair; + +using string_pair_type = std::pair; + +using string_pair_allocator = boost::interprocess::allocator; + +using pair_allocator = boost::interprocess::allocator; + +template