From 0420183bebbb5efd273d6fbb6a13cdf6f96292ca Mon Sep 17 00:00:00 2001 From: morzhovets Date: Sun, 10 Dec 2023 21:01:32 +0400 Subject: [PATCH] libcxx/Support.h --- test/sources/LibcxxTester.h | 54 ++---------------------------- test/sources/libcxx/Support.h | 62 +++++++++++++++++++++++++++++++++++ test/sources/pch.h | 2 +- 3 files changed, 66 insertions(+), 52 deletions(-) create mode 100644 test/sources/libcxx/Support.h diff --git a/test/sources/LibcxxTester.h b/test/sources/LibcxxTester.h index c7f85cda..a1dad65c 100644 --- a/test/sources/LibcxxTester.h +++ b/test/sources/LibcxxTester.h @@ -12,47 +12,12 @@ #pragma once -#include -#include -#include -#include -#include - -//#define LIBCPP_HAS_BAD_NEWS_FOR_MOMO -//#define LIBCPP_TEST_MIN_ALLOCATOR - -#define TEST_STD_VER 20 - -#include "libcxx/support/test_macros.h" - -#include "libcxx/support/MoveOnly.h" -#include "libcxx/support/Copyable.h" -#include "libcxx/support/NotConstructible.h" -#include "libcxx/support/DefaultOnly.h" -#include "libcxx/support/Emplaceable.h" -#include "libcxx/support/Counter.h" -#include "libcxx/support/Moveable.h" -#include "libcxx/support/test_allocator.h" -#include "libcxx/support/test_iterators.h" -#include "libcxx/support/test_compare.h" -#include "libcxx/support/old_test_compare.h" -#include "libcxx/support/test_hash.h" -#include "libcxx/support/private_constructor.h" -#include "libcxx/support/is_transparent.h" -#include "libcxx/support/test_transparent_unordered.h" -#include "libcxx/support/test_comparisons.h" -#include "libcxx/support/emplace_constructible.h" -#include "libcxx/support/allocators.h" -#include "libcxx/support/container_test_types.h" -#include "libcxx/support/deduction_guides_sfinae_checks.h" -#include "libcxx/support/test_container_comparisons.h" -#include "libcxx/support/set_allocator_requirement_test_templates.h" -#include "libcxx/support/map_allocator_requirement_test_templates.h" -#include "libcxx/support/asan_testing.h" -#include "libcxx/support/min_allocator.h" +#include "libcxx/Support.h" #include "../../include/momo/ObjectManager.h" +#include + namespace momo { template @@ -78,19 +43,6 @@ namespace momo }; } -template -using input_iterator = cpp17_input_iterator; - -struct LibcppIntHash -{ - size_t operator()(int key) const noexcept - { - return static_cast(key); - } -}; - -#define LIBCPP_CATCH(expr) try { (void)(expr); assert(false); } catch (...) {} - #define LIBCXX_TEST_BEGIN(name) \ namespace name \ { \ diff --git a/test/sources/libcxx/Support.h b/test/sources/libcxx/Support.h new file mode 100644 index 00000000..59f4006d --- /dev/null +++ b/test/sources/libcxx/Support.h @@ -0,0 +1,62 @@ +/**********************************************************\ + + This file is part of the + https://github.com/morzhovets/momo + project, distributed under the MIT License. See + https://github.com/morzhovets/momo/blob/master/LICENSE + for details. + + test/sources/libcxx/Support.h + +\**********************************************************/ + +#pragma once + +#include +#include +#include + +//#define LIBCPP_HAS_BAD_NEWS_FOR_MOMO + +#define TEST_STD_VER 20 + +#include "support/test_macros.h" + +#include "support/MoveOnly.h" +#include "support/Copyable.h" +#include "support/NotConstructible.h" +#include "support/DefaultOnly.h" +#include "support/Emplaceable.h" +#include "support/Counter.h" +#include "support/Moveable.h" +#include "support/test_allocator.h" +#include "support/test_iterators.h" +#include "support/test_compare.h" +#include "support/old_test_compare.h" +#include "support/test_hash.h" +#include "support/private_constructor.h" +#include "support/is_transparent.h" +#include "support/test_transparent_unordered.h" +#include "support/test_comparisons.h" +#include "support/emplace_constructible.h" +#include "support/allocators.h" +#include "support/container_test_types.h" +#include "support/deduction_guides_sfinae_checks.h" +#include "support/test_container_comparisons.h" +#include "support/set_allocator_requirement_test_templates.h" +#include "support/map_allocator_requirement_test_templates.h" +#include "support/asan_testing.h" +#include "support/min_allocator.h" + +template +using input_iterator = cpp17_input_iterator; + +struct LibcppIntHash +{ + size_t operator()(int key) const noexcept + { + return static_cast(key); + } +}; + +#define LIBCPP_CATCH(expr) try { (void)(expr); assert(false); } catch (...) {} diff --git a/test/sources/pch.h b/test/sources/pch.h index a9c00a5f..b51f6f44 100644 --- a/test/sources/pch.h +++ b/test/sources/pch.h @@ -34,4 +34,4 @@ #include #include -#include "LibcxxTester.h" +#include "LibcxxTester.h" //?