Add Catch for unit testing.

This commit is contained in:
King_DuckZ 2017-02-08 16:32:55 +00:00
commit 5a8c3fcac0
5 changed files with 60 additions and 0 deletions

28
test/unit/CMakeLists.txt Normal file
View file

@ -0,0 +1,28 @@
project(mycurry_unit_test CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable(${PROJECT_NAME}
main.cpp
)
target_compile_definitions(${PROJECT_NAME}
PRIVATE VWR_WITH_IMPLICIT_CONVERSIONS=1
PRIVATE VWR_EXTRA_ACCESSORS
)
target_include_directories(${PROJECT_NAME}
PRIVATE ${CATCH_SOURCE_DIR}/single_include
PRIVATE ${MYCURRY_SOURCE_DIR}
PRIVATE ${CMAKE_SOURCE_DIR}/lib/vectorwrapper/include
PRIVATE ${CMAKE_SOURCE_DIR}/lib/tree-2.81/src
)
add_test(
NAME CloonelJumpTest
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${PROJECT_NAME}
)

21
test/unit/main.cpp Normal file
View file

@ -0,0 +1,21 @@
/*
Copyright 2016, 2017 Michele "King_DuckZ" Santullo
This file is part of MyCurry.
MyCurry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MyCurry is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with MyCurry. If not, see <http://www.gnu.org/licenses/>.
*/
#define CATCH_CONFIG_MAIN
#include "catch.hpp"