mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
c3e5a35a6e
Provides a Catch::toString() overload for the following SFML classes, that support at least operator== and operator!=, and can thus be used in Catch assertion expressions: * String * Time * Vector2<T> * Vector3<T> * VideoMode * Color * Rect<T> The intermediate header UnitTests.hpp is introduced to ensure string conversion visibility. Do not include <catch.hpp> directly any longer.
24 lines
665 B
CMake
24 lines
665 B
CMake
set(SRCROOT "${PROJECT_SOURCE_DIR}/test/src")
|
|
|
|
SET(SRC
|
|
"${SRCROOT}/Main.cpp"
|
|
"${SRCROOT}/UnitTests.cpp"
|
|
"${SRCROOT}/Vector2.cpp"
|
|
"${SRCROOT}/Rect.cpp"
|
|
)
|
|
|
|
include_directories("${PROJECT_SOURCE_DIR}/include")
|
|
include_directories("${PROJECT_SOURCE_DIR}/extlibs/headers")
|
|
|
|
# Using sfmltest instead of test because the latter is reserved.
|
|
add_executable(sfmltest ${SRC})
|
|
|
|
target_link_libraries(sfmltest sfml-graphics sfml-window sfml-audio sfml-network sfml-system)
|
|
|
|
add_custom_target(runtests ALL
|
|
DEPENDS sfmltest
|
|
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/test"
|
|
COMMAND ${CMAKE_COMMAND} -E echo "Running test suite..."
|
|
COMMAND sfmltest
|
|
)
|