Skip to content

Commit

Permalink
libcxx/Support.h
Browse files Browse the repository at this point in the history
  • Loading branch information
morzhovets committed Dec 10, 2023
1 parent 3800b9b commit 0420183
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 52 deletions.
54 changes: 3 additions & 51 deletions test/sources/LibcxxTester.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,12 @@

#pragma once

#include <iostream>
#include <cfloat>
#include <string>
#include <cmath>
#include <ranges>

//#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 <iostream>

namespace momo
{
template<int Dummy, conceptMemManager TMemManager>
Expand All @@ -78,19 +43,6 @@ namespace momo
};
}

template<typename It>
using input_iterator = cpp17_input_iterator<It>;

struct LibcppIntHash
{
size_t operator()(int key) const noexcept
{
return static_cast<size_t>(key);
}
};

#define LIBCPP_CATCH(expr) try { (void)(expr); assert(false); } catch (...) {}

#define LIBCXX_TEST_BEGIN(name) \
namespace name \
{ \
Expand Down
62 changes: 62 additions & 0 deletions test/sources/libcxx/Support.h
Original file line number Diff line number Diff line change
@@ -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 <cfloat>
#include <string>
#include <cmath>

//#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<typename It>
using input_iterator = cpp17_input_iterator<It>;

struct LibcppIntHash
{
size_t operator()(int key) const noexcept
{
return static_cast<size_t>(key);
}
};

#define LIBCPP_CATCH(expr) try { (void)(expr); assert(false); } catch (...) {}
2 changes: 1 addition & 1 deletion test/sources/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
#include <iostream>
#include <random>

#include "LibcxxTester.h"
#include "LibcxxTester.h" //?

0 comments on commit 0420183

Please sign in to comment.