little tests refactoring

This commit is contained in:
BlackMATov
2020-11-30 18:19:23 +07:00
parent cdae59eb5b
commit 5f4697ed3d
9 changed files with 19 additions and 29 deletions

View File

@@ -16,7 +16,7 @@ endif()
# executable # executable
# #
file(GLOB UNTESTS_SOURCES "*.cpp" "*.hpp") file(GLOB_RECURSE UNTESTS_SOURCES "*.cpp" "*.hpp")
add_executable(${PROJECT_NAME} ${UNTESTS_SOURCES}) add_executable(${PROJECT_NAME} ${UNTESTS_SOURCES})
target_link_libraries(${PROJECT_NAME} flat.hpp) target_link_libraries(${PROJECT_NAME} flat.hpp)

View File

@@ -0,0 +1,2 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include "doctest.h"

View File

@@ -0,0 +1,11 @@
#pragma once
#include "doctest.h"
#define STATIC_REQUIRE(...)\
static_assert(__VA_ARGS__, #__VA_ARGS__);\
REQUIRE(__VA_ARGS__);
#define STATIC_REQUIRE_FALSE(...)\
static_assert(!(__VA_ARGS__), "!(" #__VA_ARGS__ ")");\
REQUIRE(!(__VA_ARGS__));

View File

@@ -5,9 +5,7 @@
******************************************************************************/ ******************************************************************************/
#include <flat.hpp/flat.hpp> #include <flat.hpp/flat.hpp>
#include "doctest/doctest.hpp"
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include "doctest/doctest.h"
namespace namespace
{ {

View File

@@ -5,9 +5,7 @@
******************************************************************************/ ******************************************************************************/
#include <flat.hpp/flat_map.hpp> #include <flat.hpp/flat_map.hpp>
#include "doctest/doctest.hpp"
#include "doctest/doctest.h"
#include "flat_tests.hpp"
#include <deque> #include <deque>
#include <string> #include <string>

View File

@@ -5,9 +5,7 @@
******************************************************************************/ ******************************************************************************/
#include <flat.hpp/flat_multimap.hpp> #include <flat.hpp/flat_multimap.hpp>
#include "doctest/doctest.hpp"
#include "doctest/doctest.h"
#include "flat_tests.hpp"
#include <deque> #include <deque>
#include <string> #include <string>

View File

@@ -5,9 +5,7 @@
******************************************************************************/ ******************************************************************************/
#include <flat.hpp/flat_multiset.hpp> #include <flat.hpp/flat_multiset.hpp>
#include "doctest/doctest.hpp"
#include "doctest/doctest.h"
#include "flat_tests.hpp"
#include <deque> #include <deque>
#include <string> #include <string>

View File

@@ -5,9 +5,7 @@
******************************************************************************/ ******************************************************************************/
#include <flat.hpp/flat_set.hpp> #include <flat.hpp/flat_set.hpp>
#include "doctest/doctest.hpp"
#include "doctest/doctest.h"
#include "flat_tests.hpp"
#include <deque> #include <deque>
#include <string> #include <string>

View File

@@ -1,13 +0,0 @@
/*******************************************************************************
* This file is part of the "https://github.com/blackmatov/flat.hpp"
* For conditions of distribution and use, see copyright notice in LICENSE.md
* Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com)
******************************************************************************/
#define STATIC_REQUIRE(...)\
static_assert(__VA_ARGS__, #__VA_ARGS__);\
REQUIRE(__VA_ARGS__);
#define STATIC_REQUIRE_FALSE(...)\
static_assert(!(__VA_ARGS__), "!(" #__VA_ARGS__ ")");\
REQUIRE(!(__VA_ARGS__));