Skip to content

Commit

Permalink
Renamed test targets to test-sfml-module structure
Browse files Browse the repository at this point in the history
  • Loading branch information
eXpl0it3r committed Feb 19, 2019
1 parent 1d76883 commit 7e7216f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
6 changes: 1 addition & 5 deletions cmake/Macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,8 @@ function(sfml_add_test target SOURCES DEPENDS)
# set a source group for the source files
source_group("" FILES ${SOURCES})

# check whether resources must be added in target
set(target_input ${SOURCES})

# create the target
add_executable(${target} ${target_input})
add_executable(${target} ${SOURCES})

# set the target's folder (for IDEs that support it, e.g. Visual Studio)
set_target_properties(${target} PROPERTIES FOLDER "Tests")
Expand Down Expand Up @@ -462,4 +459,3 @@ function(sfml_export_targets)
DESTINATION ${config_package_location}
COMPONENT devel)
endfunction()

10 changes: 5 additions & 5 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ SET(SYSTEM_SRC
"${SRCROOT}/TestUtilities/SystemUtil.hpp"
"${SRCROOT}/TestUtilities/SystemUtil.cpp"
)
sfml_add_test(systemtest "${SYSTEM_SRC}" sfml-system)
sfml_add_test(test-sfml-system "${SYSTEM_SRC}" sfml-system)

if(SFML_BUILD_WINDOW)
SET(WINDOW_SRC
"${SRCROOT}/CatchMain.cpp"
"${SRCROOT}/TestUtilities/WindowUtil.hpp"
"${SRCROOT}/TestUtilities/WindowUtil.cpp"
)
sfml_add_test(windowtest "${WINDOW_SRC}" sfml-window)
sfml_add_test(test-sfml-window "${WINDOW_SRC}" sfml-window)
endif()

if(SFML_BUILD_GRAPHICS)
Expand All @@ -30,15 +30,15 @@ if(SFML_BUILD_GRAPHICS)
"${SRCROOT}/TestUtilities/GraphicsUtil.hpp"
"${SRCROOT}/TestUtilities/GraphicsUtil.cpp"
)
sfml_add_test(graphicstest "${GRAPHICS_SRC}" sfml-graphics)
sfml_add_test(test-sfml-graphics "${GRAPHICS_SRC}" sfml-graphics)
endif()

# Automatically run the tests at the end of the build
add_custom_target(runtests ALL
DEPENDS systemtest windowtest graphicstest
DEPENDS test-sfml-system test-sfml-window test-sfml-graphics
)

add_custom_command(TARGET runtests
COMMENT "Run tests"
POST_BUILD COMMAND ctest ARGS --output-on-failure
)
)
2 changes: 1 addition & 1 deletion test/src/CatchMain.cpp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#define CATCH_CONFIG_MAIN
#include <catch.hpp>
#include <catch.hpp>

0 comments on commit 7e7216f

Please sign in to comment.