|
@@ -32,74 +32,73 @@ file(GLOB TestsCommon_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/Common/*.cpp
|
|
|
#===================================
|
|
#===================================
|
|
|
# Unit Tests =======================
|
|
# Unit Tests =======================
|
|
|
#===================================
|
|
#===================================
|
|
|
-if(BUILD_UNIT_TESTS)
|
|
|
|
|
- file(GLOB UnitTests_HDR_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/UnitTests/*.h )
|
|
|
|
|
- file(GLOB UnitTests_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/UnitTests/*.cpp )
|
|
|
|
|
|
|
|
|
|
- add_executable(UnitTests ${UnitTests_HDR_FILES} ${UnitTests_SRC_FILES})
|
|
|
|
|
- target_link_libraries(UnitTests RmlCore doctest::doctest)
|
|
|
|
|
- set_target_properties(UnitTests PROPERTIES CXX_STANDARD 14)
|
|
|
|
|
|
|
+file(GLOB UnitTests_HDR_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/UnitTests/*.h )
|
|
|
|
|
+file(GLOB UnitTests_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/UnitTests/*.cpp )
|
|
|
|
|
|
|
|
- add_common_target_options(UnitTests)
|
|
|
|
|
|
|
+add_executable(UnitTests ${UnitTests_HDR_FILES} ${UnitTests_SRC_FILES})
|
|
|
|
|
+target_link_libraries(UnitTests RmlCore doctest::doctest)
|
|
|
|
|
+set_target_properties(UnitTests PROPERTIES CXX_STANDARD 14)
|
|
|
|
|
|
|
|
- if(MSVC)
|
|
|
|
|
- target_compile_definitions(UnitTests PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
|
|
|
|
|
- endif()
|
|
|
|
|
|
|
+add_common_target_options(UnitTests)
|
|
|
|
|
|
|
|
- doctest_discover_tests(UnitTests)
|
|
|
|
|
|
|
+if(MSVC)
|
|
|
|
|
+ target_compile_definitions(UnitTests PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
|
|
|
endif()
|
|
endif()
|
|
|
|
|
|
|
|
|
|
+doctest_discover_tests(UnitTests)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
#===================================
|
|
#===================================
|
|
|
# Visual Tests =====================
|
|
# Visual Tests =====================
|
|
|
#===================================
|
|
#===================================
|
|
|
-if(BUILD_VISUAL_TESTS)
|
|
|
|
|
- file(GLOB VisualTests_HDR_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/VisualTests/*.h )
|
|
|
|
|
- file(GLOB VisualTests_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/VisualTests/*.cpp )
|
|
|
|
|
-
|
|
|
|
|
- if(WIN32)
|
|
|
|
|
- add_executable(VisualTests WIN32 ${VisualTests_HDR_FILES} ${VisualTests_SRC_FILES})
|
|
|
|
|
- else()
|
|
|
|
|
- add_executable(VisualTests ${VisualTests_HDR_FILES} ${VisualTests_SRC_FILES})
|
|
|
|
|
- endif()
|
|
|
|
|
-
|
|
|
|
|
- target_link_libraries(VisualTests RmlCore RmlDebugger lodepng::lodepng ${sample_LIBRARIES})
|
|
|
|
|
- set_target_properties(VisualTests PROPERTIES CXX_STANDARD 14)
|
|
|
|
|
-
|
|
|
|
|
- # Enable compiler warnings
|
|
|
|
|
- add_common_target_options(VisualTests)
|
|
|
|
|
-
|
|
|
|
|
- if(VISUAL_TESTS_DIRECTORIES)
|
|
|
|
|
- target_compile_definitions(VisualTests PRIVATE RMLUI_VISUAL_TESTS_DIRECTORIES="${VISUAL_TESTS_DIRECTORIES}")
|
|
|
|
|
- endif()
|
|
|
|
|
- if(VISUAL_TESTS_INPUT_DIRECTORY)
|
|
|
|
|
- target_compile_definitions(VisualTests PRIVATE RMLUI_VISUAL_TESTS_INPUT_DIRECTORY="${VISUAL_TESTS_INPUT_DIRECTORY}")
|
|
|
|
|
- endif()
|
|
|
|
|
- if(VISUAL_TESTS_OUTPUT_DIRECTORY)
|
|
|
|
|
- target_compile_definitions(VisualTests PRIVATE RMLUI_VISUAL_TESTS_OUTPUT_DIRECTORY="${VISUAL_TESTS_OUTPUT_DIRECTORY}")
|
|
|
|
|
- endif()
|
|
|
|
|
-
|
|
|
|
|
- if(MSVC)
|
|
|
|
|
- target_compile_definitions(VisualTests PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
|
|
|
|
|
- endif()
|
|
|
|
|
|
|
+
|
|
|
|
|
+file(GLOB VisualTests_HDR_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/VisualTests/*.h )
|
|
|
|
|
+file(GLOB VisualTests_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/VisualTests/*.cpp )
|
|
|
|
|
+
|
|
|
|
|
+if(WIN32)
|
|
|
|
|
+ add_executable(VisualTests WIN32 ${VisualTests_HDR_FILES} ${VisualTests_SRC_FILES})
|
|
|
|
|
+else()
|
|
|
|
|
+ add_executable(VisualTests ${VisualTests_HDR_FILES} ${VisualTests_SRC_FILES})
|
|
|
endif()
|
|
endif()
|
|
|
|
|
|
|
|
|
|
+target_link_libraries(VisualTests RmlCore RmlDebugger lodepng::lodepng ${sample_LIBRARIES})
|
|
|
|
|
+set_target_properties(VisualTests PROPERTIES CXX_STANDARD 14)
|
|
|
|
|
+
|
|
|
|
|
+# Enable compiler warnings
|
|
|
|
|
+add_common_target_options(VisualTests)
|
|
|
|
|
+
|
|
|
|
|
+if(VISUAL_TESTS_RML_DIRECTORIES)
|
|
|
|
|
+ target_compile_definitions(VisualTests PRIVATE RMLUI_VISUAL_TESTS_RML_DIRECTORIES="${VISUAL_TESTS_RML_DIRECTORIES}")
|
|
|
|
|
+endif()
|
|
|
|
|
+if(VISUAL_TESTS_COMPARE_DIRECTORY)
|
|
|
|
|
+ target_compile_definitions(VisualTests PRIVATE RMLUI_VISUAL_TESTS_COMPARE_DIRECTORY="${VISUAL_TESTS_COMPARE_DIRECTORY}")
|
|
|
|
|
+endif()
|
|
|
|
|
+if(VISUAL_TESTS_CAPTURE_DIRECTORY)
|
|
|
|
|
+ target_compile_definitions(VisualTests PRIVATE RMLUI_VISUAL_TESTS_CAPTURE_DIRECTORY="${VISUAL_TESTS_CAPTURE_DIRECTORY}")
|
|
|
|
|
+endif()
|
|
|
|
|
+
|
|
|
|
|
+if(MSVC)
|
|
|
|
|
+ target_compile_definitions(VisualTests PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
|
|
|
|
|
+endif()
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
#===================================
|
|
#===================================
|
|
|
# Benchmarks =======================
|
|
# Benchmarks =======================
|
|
|
#===================================
|
|
#===================================
|
|
|
-if(BUILD_BENCHMARKS)
|
|
|
|
|
- file(GLOB Benchmarks_HDR_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/Benchmarks/*.h )
|
|
|
|
|
- file(GLOB Benchmarks_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/Benchmarks/*.cpp )
|
|
|
|
|
|
|
|
|
|
- add_executable(Benchmarks ${Benchmarks_HDR_FILES} ${Benchmarks_SRC_FILES} ${TestsCommon_HDR_FILES} ${TestsCommon_SRC_FILES})
|
|
|
|
|
- target_link_libraries(Benchmarks RmlCore RmlDebugger doctest::doctest nanobench::nanobench ${sample_LIBRARIES})
|
|
|
|
|
- set_target_properties(Benchmarks PROPERTIES CXX_STANDARD 14)
|
|
|
|
|
|
|
+file(GLOB Benchmarks_HDR_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/Benchmarks/*.h )
|
|
|
|
|
+file(GLOB Benchmarks_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Source/Benchmarks/*.cpp )
|
|
|
|
|
+
|
|
|
|
|
+add_executable(Benchmarks ${Benchmarks_HDR_FILES} ${Benchmarks_SRC_FILES} ${TestsCommon_HDR_FILES} ${TestsCommon_SRC_FILES})
|
|
|
|
|
+target_link_libraries(Benchmarks RmlCore RmlDebugger doctest::doctest nanobench::nanobench ${sample_LIBRARIES})
|
|
|
|
|
+set_target_properties(Benchmarks PROPERTIES CXX_STANDARD 14)
|
|
|
|
|
|
|
|
- # Enable compiler warnings
|
|
|
|
|
- add_common_target_options(Benchmarks)
|
|
|
|
|
|
|
+# Enable compiler warnings
|
|
|
|
|
+add_common_target_options(Benchmarks)
|
|
|
|
|
|
|
|
- if(MSVC)
|
|
|
|
|
- target_compile_definitions(Benchmarks PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
|
|
|
|
|
- endif()
|
|
|
|
|
-endif()
|
|
|
|
|
|
|
+if(MSVC)
|
|
|
|
|
+ target_compile_definitions(Benchmarks PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
|
|
|
|
|
+endif()
|