summaryrefslogtreecommitdiffstats
path: root/tests/OSSupport/CMakeLists.txt
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-06-26 15:51:12 +0200
committerworktycho <work.tycho@gmail.com>2016-06-26 15:51:12 +0200
commit1462e4f70e6bc8e42f6a5b5e959b7e34f2774a73 (patch)
treeb94e203e895c25d7724c3db71564fcbf4027fb9e /tests/OSSupport/CMakeLists.txt
parentMerge pull request #3240 from cuberite/grownvisualizer (diff)
downloadcuberite-1462e4f70e6bc8e42f6a5b5e959b7e34f2774a73.tar
cuberite-1462e4f70e6bc8e42f6a5b5e959b7e34f2774a73.tar.gz
cuberite-1462e4f70e6bc8e42f6a5b5e959b7e34f2774a73.tar.bz2
cuberite-1462e4f70e6bc8e42f6a5b5e959b7e34f2774a73.tar.lz
cuberite-1462e4f70e6bc8e42f6a5b5e959b7e34f2774a73.tar.xz
cuberite-1462e4f70e6bc8e42f6a5b5e959b7e34f2774a73.tar.zst
cuberite-1462e4f70e6bc8e42f6a5b5e959b7e34f2774a73.zip
Diffstat (limited to 'tests/OSSupport/CMakeLists.txt')
-rw-r--r--tests/OSSupport/CMakeLists.txt50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/OSSupport/CMakeLists.txt b/tests/OSSupport/CMakeLists.txt
new file mode 100644
index 000000000..8fff570a4
--- /dev/null
+++ b/tests/OSSupport/CMakeLists.txt
@@ -0,0 +1,50 @@
+cmake_minimum_required (VERSION 2.6)
+
+enable_testing()
+
+include_directories(${CMAKE_SOURCE_DIR}/src/)
+
+add_definitions(-DTEST_GLOBALS=1)
+
+# Create a single OSSupport library that contains all the OSSupport code used in the tests:
+# Only needed for Windows; Linux already defines the OSSupport lib
+if (WIN32)
+ set (OSSupport_SRCS
+ ${CMAKE_SOURCE_DIR}/src/OSSupport/CriticalSection.cpp
+ ${CMAKE_SOURCE_DIR}/src/OSSupport/Event.cpp
+ ${CMAKE_SOURCE_DIR}/src/StringUtils.cpp
+ )
+ set (OSSupport_HDRS
+ ${CMAKE_SOURCE_DIR}/src/OSSupport/CriticalSection.h
+ ${CMAKE_SOURCE_DIR}/src/OSSupport/Event.h
+ ${CMAKE_SOURCE_DIR}/src/StringUtils.h
+ ${CMAKE_SOURCE_DIR}/src/Globals.h
+ )
+ add_library(OSSupport
+ ${OSSupport_SRCS}
+ ${OSSupport_HDRS}
+ )
+endif()
+
+# Define individual tests:
+
+# StressEvent: Stress-test the cEvent implementation:
+add_executable(StressEvent-exe StressEvent.cpp)
+target_link_libraries(StressEvent-exe OSSupport)
+add_test(NAME StressEvent-test COMMAND StressEvent-exe)
+
+
+
+# Put all the tests into a solution folder (MSVC):
+set_target_properties(
+ StressEvent-exe
+ PROPERTIES FOLDER Tests/OSSupport
+)
+set_target_properties(
+ OSSupport
+ PROPERTIES FOLDER Lib
+)
+
+
+
+