Import Catch and make a unit test program that uses it.
This commit is contained in:
parent
ce9eff82f1
commit
7f49ef36d6
5 changed files with 25 additions and 0 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -1,3 +1,6 @@
|
||||||
[submodule "lib/vectorwrapper"]
|
[submodule "lib/vectorwrapper"]
|
||||||
path = lib/vectorwrapper
|
path = lib/vectorwrapper
|
||||||
url = https://github.com/KingDuckZ/vectorwrapper.git
|
url = https://github.com/KingDuckZ/vectorwrapper.git
|
||||||
|
[submodule "lib/catch"]
|
||||||
|
path = lib/catch
|
||||||
|
url = https://github.com/philsquared/Catch.git
|
||||||
|
|
|
@ -4,6 +4,7 @@ project(CloonelJump CXX)
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/include")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/include")
|
||||||
|
|
||||||
include(TargetArch)
|
include(TargetArch)
|
||||||
|
include(CTest)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wconversion")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wconversion")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -pedantic -Wconversion -DWITH_DEBUG_VISUALS -O0")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -pedantic -Wconversion -DWITH_DEBUG_VISUALS -O0")
|
||||||
|
@ -140,6 +141,9 @@ if (RASPBERRY_PI)
|
||||||
)
|
)
|
||||||
endif(RASPBERRY_PI)
|
endif(RASPBERRY_PI)
|
||||||
|
|
||||||
|
if (BUILD_TESTING)
|
||||||
|
add_subdirectory(test/unit)
|
||||||
|
endif()
|
||||||
target_compile_features(${PROJECT_NAME}
|
target_compile_features(${PROJECT_NAME}
|
||||||
PRIVATE cxx_nullptr
|
PRIVATE cxx_nullptr
|
||||||
PRIVATE cxx_range_for
|
PRIVATE cxx_range_for
|
||||||
|
|
1
lib/catch
Submodule
1
lib/catch
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 30cebd617788f6b399297725f97317f9bc462114
|
15
test/unit/CMakeLists.txt
Normal file
15
test/unit/CMakeLists.txt
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
project(clooneltest CXX)
|
||||||
|
|
||||||
|
add_executable(${PROJECT_NAME}
|
||||||
|
main.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME}
|
||||||
|
PRIVATE ${CMAKE_SOURCE_DIR}/lib/catch/single_include
|
||||||
|
)
|
||||||
|
|
||||||
|
add_test(
|
||||||
|
NAME CloonelJumpTest
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
COMMAND ${PROJECT_NAME}
|
||||||
|
)
|
2
test/unit/main.cpp
Normal file
2
test/unit/main.cpp
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#define CATCH_CONFIG_MAIN
|
||||||
|
#include "catch.hpp"
|
Loading…
Add table
Add a link
Reference in a new issue