Add tests and update CMake to build them
Add comprehensive unit tests in tests/test_all.cpp Refactor CMakeLists: set C++17 and CMAKE_CXX_STANDARD_REQUIRED, introduce a SOURCES list used by executables, add a deep_miner_tests target, and set cmake_minimum_required to 3.15
This commit is contained in:
+20
-16
@@ -1,22 +1,26 @@
|
||||
cmake_minimum_required(VERSION 4.2)
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
project(deep_miner)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
include_directories(include)
|
||||
|
||||
set(SOURCES
|
||||
src/BaseRobot.cpp
|
||||
src/SortBot.cpp
|
||||
src/World.cpp
|
||||
src/DigDeepBot.cpp
|
||||
src/Game.cpp
|
||||
src/RandomBot.cpp
|
||||
)
|
||||
|
||||
add_executable(deep_miner
|
||||
include/BaseRobot.h
|
||||
include/Robot.h
|
||||
include/SortBot.h
|
||||
include/World.h
|
||||
src/BaseRobot.cpp
|
||||
src/SortBot.cpp
|
||||
src/World.cpp
|
||||
include/Game.h
|
||||
include/DigDeepBot.h
|
||||
include/RandomBot.h
|
||||
src/DigDeepBot.cpp
|
||||
src/Game.cpp
|
||||
src/RandomBot.cpp
|
||||
main.cpp)
|
||||
${SOURCES}
|
||||
main.cpp
|
||||
)
|
||||
|
||||
add_executable(deep_miner_tests
|
||||
${SOURCES}
|
||||
tests/test_all.cpp
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user