2017-02-13 10:50:35 -05:00
|
|
|
enable_testing()
|
|
|
|
|
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/src/)
|
|
|
|
include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/lib/)
|
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
|
|
|
add_definitions(-DTEST_GLOBALS=1)
|
|
|
|
|
|
|
|
set (SHARED_SRCS
|
|
|
|
${CMAKE_SOURCE_DIR}/src/BiomeDef.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/src/BlockArea.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/src/Cuboid.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/src/ChunkData.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/src/StringCompression.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/src/StringUtils.cpp
|
|
|
|
|
|
|
|
${CMAKE_SOURCE_DIR}/src/Bindings/LuaState.cpp
|
|
|
|
|
|
|
|
${CMAKE_SOURCE_DIR}/src/Generating/ChunkDesc.cpp
|
2017-02-26 16:49:23 -05:00
|
|
|
${CMAKE_SOURCE_DIR}/src/Generating/PiecePool.cpp
|
2017-02-13 10:50:35 -05:00
|
|
|
${CMAKE_SOURCE_DIR}/src/Generating/Prefab.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/src/Generating/PrefabPiecePool.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/src/Generating/VerticalLimit.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/src/Generating/VerticalStrategy.cpp
|
|
|
|
|
|
|
|
${CMAKE_SOURCE_DIR}/src/Noise/Noise.cpp
|
|
|
|
|
|
|
|
${CMAKE_SOURCE_DIR}/src/OSSupport/CriticalSection.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/src/OSSupport/Event.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/src/OSSupport/File.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/src/OSSupport/GZipFile.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/src/OSSupport/StackTrace.cpp
|
2017-06-19 05:05:19 -04:00
|
|
|
${CMAKE_SOURCE_DIR}/src/OSSupport/WinStackWalker.cpp
|
2017-02-13 10:50:35 -05:00
|
|
|
|
|
|
|
${CMAKE_SOURCE_DIR}/src/WorldStorage/FastNBT.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/src/WorldStorage/SchematicFileSerializer.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set (SHARED_HDRS
|
|
|
|
${CMAKE_SOURCE_DIR}/src/BiomeDef.h
|
|
|
|
${CMAKE_SOURCE_DIR}/src/BlockArea.h
|
|
|
|
${CMAKE_SOURCE_DIR}/src/Cuboid.h
|
|
|
|
${CMAKE_SOURCE_DIR}/src/ChunkData.h
|
|
|
|
${CMAKE_SOURCE_DIR}/src/Globals.h
|
|
|
|
${CMAKE_SOURCE_DIR}/src/StringCompression.h
|
|
|
|
${CMAKE_SOURCE_DIR}/src/StringUtils.h
|
|
|
|
|
|
|
|
${CMAKE_SOURCE_DIR}/src/Bindings/LuaState.h
|
|
|
|
|
|
|
|
${CMAKE_SOURCE_DIR}/src/Generating/ChunkDesc.h
|
2017-02-26 16:49:23 -05:00
|
|
|
${CMAKE_SOURCE_DIR}/src/Generating/PiecePool.h
|
2017-02-13 10:50:35 -05:00
|
|
|
${CMAKE_SOURCE_DIR}/src/Generating/Prefab.h
|
|
|
|
${CMAKE_SOURCE_DIR}/src/Generating/PrefabPiecePool.h
|
|
|
|
${CMAKE_SOURCE_DIR}/src/Generating/VerticalLimit.h
|
|
|
|
${CMAKE_SOURCE_DIR}/src/Generating/VerticalStrategy.h
|
|
|
|
|
|
|
|
${CMAKE_SOURCE_DIR}/src/Noise/Noise.h
|
|
|
|
|
|
|
|
${CMAKE_SOURCE_DIR}/src/OSSupport/CriticalSection.h
|
|
|
|
${CMAKE_SOURCE_DIR}/src/OSSupport/Event.h
|
|
|
|
${CMAKE_SOURCE_DIR}/src/OSSupport/File.h
|
|
|
|
${CMAKE_SOURCE_DIR}/src/OSSupport/GZipFile.h
|
|
|
|
${CMAKE_SOURCE_DIR}/src/OSSupport/StackTrace.h
|
2017-06-19 05:05:19 -04:00
|
|
|
${CMAKE_SOURCE_DIR}/src/OSSupport/WinStackWalker.h
|
2017-02-13 10:50:35 -05:00
|
|
|
|
|
|
|
${CMAKE_SOURCE_DIR}/src/WorldStorage/FastNBT.h
|
|
|
|
${CMAKE_SOURCE_DIR}/src/WorldStorage/SchematicFileSerializer.h
|
|
|
|
)
|
|
|
|
|
2017-02-26 17:03:24 -05:00
|
|
|
set (STUBS
|
2017-02-13 10:50:35 -05:00
|
|
|
Stubs.cpp
|
|
|
|
LuaState_Typedefs.inc
|
|
|
|
LuaState_Declaration.inc
|
|
|
|
Bindings.h
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
|
|
add_flags_cxx("-Wno-error=global-constructors")
|
|
|
|
add_flags_cxx("-Wno-error=switch-enum")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-26 17:03:24 -05:00
|
|
|
add_library(GeneratorTestingSupport STATIC ${SHARED_SRCS} ${SHARED_HDRS} ${STUBS})
|
|
|
|
target_link_libraries(GeneratorTestingSupport tolualib zlib)
|
|
|
|
source_group("Stubs" FILES ${STUBS})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# LoadablePieces test:
|
|
|
|
source_group("Data files" FILES Test.cubeset Test1.schematic)
|
|
|
|
add_executable(LoadablePieces LoadablePieces.cpp Test.cubeset Test1.schematic)
|
|
|
|
target_link_libraries(LoadablePieces GeneratorTestingSupport)
|
|
|
|
add_test(NAME LoadablePieces-test WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND LoadablePieces)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# PieceRotation test:
|
|
|
|
add_executable(PieceRotation PieceRotationTest.cpp)
|
|
|
|
target_link_libraries(PieceRotation GeneratorTestingSupport)
|
2017-02-13 10:50:35 -05:00
|
|
|
add_test(NAME PieceRotation-test WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND PieceRotation)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-26 17:03:24 -05:00
|
|
|
|
2017-03-22 09:05:28 -04:00
|
|
|
# PieceGeneratorBFSTree test:
|
|
|
|
add_executable(PieceGeneratorBFSTree
|
|
|
|
PieceGeneratorBFSTreeTest.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/src/Generating/PieceGeneratorBFSTree.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/src/Generating/PieceGeneratorBFSTree.h
|
|
|
|
)
|
|
|
|
target_link_libraries(PieceGeneratorBFSTree GeneratorTestingSupport)
|
|
|
|
add_test(NAME PieceGeneratorBFSTree-test WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Server/Prefabs/PieceStructures COMMAND PieceGeneratorBFSTree)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-13 10:50:35 -05:00
|
|
|
# Put the projects into solution folders (MSVC):
|
|
|
|
set_target_properties(
|
2017-02-26 17:03:24 -05:00
|
|
|
GeneratorTestingSupport
|
|
|
|
LoadablePieces
|
2017-03-22 09:05:28 -04:00
|
|
|
PieceGeneratorBFSTree
|
2017-02-13 10:50:35 -05:00
|
|
|
PieceRotation
|
2017-02-26 17:03:24 -05:00
|
|
|
PROPERTIES FOLDER Tests/Generating
|
2017-02-13 10:50:35 -05:00
|
|
|
)
|