add doctest as submodule

This commit is contained in:
BlackMATov
2021-08-06 02:42:13 +07:00
parent 689740b858
commit 85ff0b31fd
8 changed files with 7 additions and 6598 deletions

3
.gitmodules vendored
View File

@@ -4,3 +4,6 @@
[submodule "vendors/kari.hpp"]
path = vendors/kari.hpp
url = https://github.com/BlackMATov/kari.hpp
[submodule "vendors/doctest"]
path = vendors/doctest
url = https://github.com/onqtam/doctest

View File

@@ -32,6 +32,7 @@ if(BUILD_AS_STANDALONE)
option(BUILD_WITH_UNTESTS "Build with unit tests" ON)
if(BUILD_WITH_UNTESTS)
enable_testing()
add_subdirectory(vendors/doctest)
add_subdirectory(untests)
endif()
endif()

View File

@@ -18,7 +18,7 @@ endif()
file(GLOB_RECURSE UNTESTS_SOURCES "*.cpp" "*.hpp")
add_executable(${PROJECT_NAME} ${UNTESTS_SOURCES})
target_link_libraries(${PROJECT_NAME} meta.hpp)
target_link_libraries(${PROJECT_NAME} meta.hpp doctest_with_main)
target_compile_options(${PROJECT_NAME}
PRIVATE

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +0,0 @@
#pragma once
#include "doctest.h"
// https://github.com/onqtam/doctest/issues/126
#include <iostream>
#define STATIC_CHECK(...)\
static_assert(__VA_ARGS__, #__VA_ARGS__);\
CHECK(__VA_ARGS__)
#define STATIC_CHECK_FALSE(...)\
static_assert(!(__VA_ARGS__), "!(" #__VA_ARGS__ ")");\
CHECK(!(__VA_ARGS__))

View File

@@ -7,4 +7,4 @@
#pragma once
#include <meta.hpp/meta_all.hpp>
#include "doctest/doctest.hpp"
#include <doctest/doctest.h>

1
vendors/doctest vendored Submodule

Submodule vendors/doctest added at 4d8716f1ef