Moved unit tests into their respective module's subfolders
This commit is contained in:
@@ -1,9 +1,18 @@
|
||||
cmake_minimum_required(VERSION 3.6)
|
||||
cmake_minimum_required (VERSION 3.11)
|
||||
project(Vector3D)
|
||||
|
||||
add_subdirectory(unit-tests)
|
||||
add_subdirectory(src)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
add_compile_options(-fdiagnostics-color=always -Wall -Wextra -Wpedantic)
|
||||
add_compile_options(-fdiagnostics-color=always -Wall -Wextra -Wpedantic)
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
Catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG v3.8.0 # or a later release
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(Catch2)
|
||||
@@ -23,4 +23,13 @@ target_link_libraries(matrix
|
||||
set_target_properties(matrix
|
||||
PROPERTIES
|
||||
LINKER_LANGUAGE CXX
|
||||
)
|
||||
|
||||
# matrix tests
|
||||
add_executable(matrix-tests unit-tests/matrix-tests.cpp)
|
||||
|
||||
target_link_libraries(matrix-tests
|
||||
PRIVATE
|
||||
matrix-intf
|
||||
Catch2::Catch2WithMain
|
||||
)
|
||||
@@ -28,4 +28,13 @@ target_link_libraries(quaternion
|
||||
set_target_properties(quaternion
|
||||
PROPERTIES
|
||||
LINKER_LANGUAGE CXX
|
||||
)
|
||||
|
||||
# Quaternion tests
|
||||
add_executable(quaternion-tests unit-tests/quaternion-tests.cpp)
|
||||
|
||||
target_link_libraries(quaternion-tests
|
||||
PRIVATE
|
||||
quaternion
|
||||
Catch2::Catch2WithMain
|
||||
)
|
||||
@@ -18,4 +18,14 @@ target_link_libraries(vector-3d
|
||||
PUBLIC
|
||||
vector-3d-intf
|
||||
PRIVATE
|
||||
)
|
||||
|
||||
# vector tests
|
||||
add_executable(vector-tests unit-tests/vector-tests.cpp)
|
||||
|
||||
target_link_libraries(vector-tests
|
||||
PRIVATE
|
||||
matrix-intf
|
||||
vector-3d-intf
|
||||
Catch2::Catch2WithMain
|
||||
)
|
||||
@@ -1,41 +0,0 @@
|
||||
cmake_minimum_required (VERSION 3.11)
|
||||
|
||||
project ("test_driver")
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
Catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG v3.8.0 # or a later release
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(Catch2)
|
||||
|
||||
# matrix tests
|
||||
add_executable(matrix-tests matrix-tests.cpp)
|
||||
|
||||
target_link_libraries(matrix-tests
|
||||
PRIVATE
|
||||
matrix-intf
|
||||
Catch2::Catch2WithMain
|
||||
)
|
||||
|
||||
# vector tests
|
||||
add_executable(vector-tests vector-tests.cpp)
|
||||
|
||||
target_link_libraries(vector-tests
|
||||
PRIVATE
|
||||
matrix-intf
|
||||
vector-3d-intf
|
||||
Catch2::Catch2WithMain
|
||||
)
|
||||
|
||||
# quaternion tests
|
||||
add_executable(quaternion-tests quaternion-tests.cpp)
|
||||
|
||||
target_link_libraries(quaternion-tests
|
||||
PRIVATE
|
||||
quaternion
|
||||
Catch2::Catch2WithMain
|
||||
)
|
||||
Reference in New Issue
Block a user