mirror of
https://github.com/BlackMATov/enum.hpp.git
synced 2025-12-13 06:59:45 +07:00
initial commit
This commit is contained in:
50
untests/CMakeLists.txt
Normal file
50
untests/CMakeLists.txt
Normal file
@@ -0,0 +1,50 @@
|
||||
# 3.11 version is required for `FetchContent`
|
||||
cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
|
||||
|
||||
project(enum.hpp.untests)
|
||||
|
||||
#
|
||||
# coverage
|
||||
#
|
||||
|
||||
option(BUILD_WITH_COVERAGE "Build with coverage" OFF)
|
||||
if(BUILD_WITH_COVERAGE AND (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang"))
|
||||
set(COVERAGE_FLAGS "--coverage")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COVERAGE_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COVERAGE_FLAGS}")
|
||||
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} ${COVERAGE_FLAGS}")
|
||||
endif()
|
||||
|
||||
#
|
||||
# executable
|
||||
#
|
||||
|
||||
file(GLOB UNTESTS_SOURCES "*.cpp" "*.hpp")
|
||||
add_executable(${PROJECT_NAME} ${UNTESTS_SOURCES})
|
||||
target_link_libraries(${PROJECT_NAME} enum.hpp)
|
||||
|
||||
target_compile_options(${PROJECT_NAME}
|
||||
PRIVATE
|
||||
$<$<CXX_COMPILER_ID:MSVC>:
|
||||
/W4>
|
||||
PRIVATE
|
||||
$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
|
||||
-Wall -Wextra -Wpedantic>)
|
||||
|
||||
add_test(${PROJECT_NAME} ${PROJECT_NAME})
|
||||
|
||||
#
|
||||
# catchorg/catch2
|
||||
#
|
||||
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
catchorg_catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/catch2)
|
||||
|
||||
FetchContent_GetProperties(catchorg_catch2)
|
||||
if(NOT catchorg_catch2_POPULATED)
|
||||
FetchContent_Populate(catchorg_catch2)
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
PRIVATE ${catchorg_catch2_SOURCE_DIR}/single_include)
|
||||
endif()
|
||||
9
untests/catch_main.cpp
Normal file
9
untests/catch_main.cpp
Normal file
@@ -0,0 +1,9 @@
|
||||
/*******************************************************************************
|
||||
* This file is part of the "https://github.com/blackmatov/enum.hpp"
|
||||
* For conditions of distribution and use, see copyright notice in LICENSE.md
|
||||
* Copyright (C) 2019 Matvey Cherevko
|
||||
******************************************************************************/
|
||||
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#define CATCH_CONFIG_FAST_COMPILE
|
||||
#include <catch2/catch.hpp>
|
||||
13
untests/enum_tests.cpp
Normal file
13
untests/enum_tests.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
/*******************************************************************************
|
||||
* This file is part of the "https://github.com/blackmatov/enum.hpp"
|
||||
* For conditions of distribution and use, see copyright notice in LICENSE.md
|
||||
* Copyright (C) 2019, by Matvey Cherevko (blackmatov@gmail.com)
|
||||
******************************************************************************/
|
||||
|
||||
#define CATCH_CONFIG_FAST_COMPILE
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
#include <enum.hpp/enum.hpp>
|
||||
|
||||
TEST_CASE("enum") {
|
||||
}
|
||||
Reference in New Issue
Block a user