diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 73712d36..beb4b204 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -5,13 +5,15 @@ set(SRCROOT "${PROJECT_SOURCE_DIR}/test/src") include_directories("${PROJECT_SOURCE_DIR}/include") include_directories("${PROJECT_SOURCE_DIR}/extlibs/headers") +include_directories("${SRCROOT}/TestUtilities") # System is always built SET(SYSTEM_SRC - "${SRCROOT}/Vector2.cpp" - "${SRCROOT}/Vector3.cpp" - "${SRCROOT}/TestUtilities/System.hpp" - "${SRCROOT}/TestUtilities/System.cpp" + "${SRCROOT}/CatchMain.cpp" + "${SRCROOT}/System/Vector2.cpp" + "${SRCROOT}/System/Vector3.cpp" + "${SRCROOT}/TestUtilities/SystemUtil.hpp" + "${SRCROOT}/TestUtilities/SystemUtil.cpp" ) add_executable(systemtest ${SYSTEM_SRC}) target_link_libraries(systemtest sfml-system) @@ -19,9 +21,9 @@ catch_discover_tests(systemtest) if(SFML_BUILD_WINDOW) SET(WINDOW_SRC - "${SRCROOT}/Window.cpp" - "${SRCROOT}/TestUtilities/Window.hpp" - "${SRCROOT}/TestUtilities/Window.cpp" + "${SRCROOT}/CatchMain.cpp" + "${SRCROOT}/TestUtilities/WindowUtil.hpp" + "${SRCROOT}/TestUtilities/WindowUtil.cpp" ) add_executable(windowtest ${WINDOW_SRC}) target_link_libraries(windowtest sfml-window) @@ -30,9 +32,10 @@ endif() if(SFML_BUILD_GRAPHICS) SET(GRAPHICS_SRC - "${SRCROOT}/Rect.cpp" - "${SRCROOT}/TestUtilities/Graphics.hpp" - "${SRCROOT}/TestUtilities/Graphics.cpp" + "${SRCROOT}/CatchMain.cpp" + "${SRCROOT}/Graphics/Rect.cpp" + "${SRCROOT}/TestUtilities/GraphicsUtil.hpp" + "${SRCROOT}/TestUtilities/GraphicsUtil.cpp" ) add_executable(graphicstest ${GRAPHICS_SRC}) target_link_libraries(graphicstest sfml-graphics) diff --git a/test/src/CatchMain.cpp b/test/src/CatchMain.cpp new file mode 100644 index 00000000..fd9339d7 --- /dev/null +++ b/test/src/CatchMain.cpp @@ -0,0 +1,2 @@ +#define CATCH_CONFIG_MAIN +#include \ No newline at end of file diff --git a/test/src/Rect.cpp b/test/src/Graphics/Rect.cpp similarity index 98% rename from test/src/Rect.cpp rename to test/src/Graphics/Rect.cpp index e35aa397..e67fd91e 100644 --- a/test/src/Rect.cpp +++ b/test/src/Graphics/Rect.cpp @@ -1,8 +1,6 @@ -#define CATCH_CONFIG_MAIN - #include #include -#include "TestUtilities/Graphics.hpp" +#include "GraphicsUtil.hpp" TEST_CASE("sf::Rect class template", "[graphics]") { diff --git a/test/src/Vector2.cpp b/test/src/System/Vector2.cpp similarity index 98% rename from test/src/Vector2.cpp rename to test/src/System/Vector2.cpp index 175ebee2..bb3b28ea 100644 --- a/test/src/Vector2.cpp +++ b/test/src/System/Vector2.cpp @@ -1,7 +1,5 @@ -#define CATCH_CONFIG_MAIN - #include -#include "TestUtilities/System.hpp" +#include "SystemUtil.hpp" // Use sf::Vector2i for tests. Test coverage is given, as there are no template specializations. diff --git a/test/src/Vector3.cpp b/test/src/System/Vector3.cpp similarity index 99% rename from test/src/Vector3.cpp rename to test/src/System/Vector3.cpp index cf80fb1d..948a0ff7 100644 --- a/test/src/Vector3.cpp +++ b/test/src/System/Vector3.cpp @@ -1,5 +1,5 @@ #include -#include "TestUtilities/System.hpp" +#include "SystemUtil.hpp" // Use sf::Vector3i for tests. Test coverage is given, as there are no template specializations. diff --git a/test/src/TestUtilities/Graphics.cpp b/test/src/TestUtilities/GraphicsUtil.cpp similarity index 100% rename from test/src/TestUtilities/Graphics.cpp rename to test/src/TestUtilities/GraphicsUtil.cpp diff --git a/test/src/TestUtilities/Graphics.hpp b/test/src/TestUtilities/GraphicsUtil.hpp similarity index 95% rename from test/src/TestUtilities/Graphics.hpp rename to test/src/TestUtilities/GraphicsUtil.hpp index a251bc56..2a792e4c 100644 --- a/test/src/TestUtilities/Graphics.hpp +++ b/test/src/TestUtilities/GraphicsUtil.hpp @@ -6,7 +6,7 @@ #ifndef SFML_TESTUTILITIES_GRAPHICS_HPP #define SFML_TESTUTILITIES_GRAPHICS_HPP -#include "Window.hpp" +#include "WindowUtil.hpp" // Forward declarations for non-template types namespace sf diff --git a/test/src/TestUtilities/System.cpp b/test/src/TestUtilities/SystemUtil.cpp similarity index 100% rename from test/src/TestUtilities/System.cpp rename to test/src/TestUtilities/SystemUtil.cpp diff --git a/test/src/TestUtilities/System.hpp b/test/src/TestUtilities/SystemUtil.hpp similarity index 100% rename from test/src/TestUtilities/System.hpp rename to test/src/TestUtilities/SystemUtil.hpp diff --git a/test/src/TestUtilities/Window.cpp b/test/src/TestUtilities/WindowUtil.cpp similarity index 100% rename from test/src/TestUtilities/Window.cpp rename to test/src/TestUtilities/WindowUtil.cpp diff --git a/test/src/TestUtilities/Window.hpp b/test/src/TestUtilities/WindowUtil.hpp similarity index 97% rename from test/src/TestUtilities/Window.hpp rename to test/src/TestUtilities/WindowUtil.hpp index 3ddc158f..b0a9f21d 100644 --- a/test/src/TestUtilities/Window.hpp +++ b/test/src/TestUtilities/WindowUtil.hpp @@ -6,7 +6,7 @@ #ifndef SFML_TESTUTILITIES_WINDOW_HPP #define SFML_TESTUTILITIES_WINDOW_HPP -#include "System.hpp" +#include "SystemUtil.hpp" #include diff --git a/test/src/Window.cpp b/test/src/Window.cpp deleted file mode 100644 index e5733626..00000000 --- a/test/src/Window.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#define CATCH_CONFIG_MAIN - -#include -#include -#include "TestUtilities/Window.hpp" - -TEST_CASE("Window unit test exists", "[window]") -{ - CHECK(TRUE); -}