Skip to content
Snippets Groups Projects
Commit 2cc53e4d authored by Sebastian Freitag's avatar Sebastian Freitag
Browse files

Merge branch 'feature/#69_OpenGl_Mock_Failing_MSVS' into 'develop'

Feature/#69 open gl mock failing msvs

See merge request !17
parents 01538274 0ac54fff
No related branches found
No related tags found
2 merge requests!19Release/v17.09.0,!17Feature/#69 open gl mock failing msvs
...@@ -173,7 +173,6 @@ test:linux:gcc4.9.2: ...@@ -173,7 +173,6 @@ test:linux:gcc4.9.2:
script: script:
- cd build - cd build
- make test - make test
test:linux:gcc5.3.1: test:linux:gcc5.3.1:
stage: test stage: test
tags: tags:
......
...@@ -25,6 +25,7 @@ project(ProjectPhoenix) ...@@ -25,6 +25,7 @@ project(ProjectPhoenix)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 14)
link_directories(${CMAKE_CURRENT_BINARY_DIR}/lib)
# needs to be first since other scripts might rely on this # needs to be first since other scripts might rely on this
include(ConanHelpers) include(ConanHelpers)
......
...@@ -36,7 +36,7 @@ function(CONFIGURE_MSVC_USERFILE TARGET_NAME PATH_TO_ADD) ...@@ -36,7 +36,7 @@ function(CONFIGURE_MSVC_USERFILE TARGET_NAME PATH_TO_ADD)
"${CMAKE_SOURCE_DIR}/cmake/VisualStudio2013.vcxproj.user.in") "${CMAKE_SOURCE_DIR}/cmake/VisualStudio2013.vcxproj.user.in")
set(DESTINATION_USER_FILE set(DESTINATION_USER_FILE
"${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.vcxproj.user") "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.vcxproj.user")
message("DESTINATION_USER_FILE: ${DESTINATION_USER_FILE}") message(STATUS "DESTINATION_USER_FILE: ${DESTINATION_USER_FILE}")
configure_file(${SOURCE_USER_FILE} ${DESTINATION_USER_FILE} @ONLY) configure_file(${SOURCE_USER_FILE} ${DESTINATION_USER_FILE} @ONLY)
endfunction() endfunction()
......
...@@ -34,3 +34,20 @@ class ProjectPhoenix(ConanFile): ...@@ -34,3 +34,20 @@ class ProjectPhoenix(ConanFile):
("SDL2/2.0.5@RWTH-VR/thirdparty"), ("SDL2/2.0.5@RWTH-VR/thirdparty"),
("trompeloeil/v25@rollbear/stable")) # comma separated list of requirements ("trompeloeil/v25@rollbear/stable")) # comma separated list of requirements
generators = "cmake" generators = "cmake"
def configure(self):
self.options["glew"].shared = True
def imports(self):
self.copy("*.dll", dst="lib", src="bin")
#since cmake cannot easily tell Visual Studio where to find the dlls we have to do the following
self.copy("*.dll", dst="tests/Debug", src="bin")
self.copy("*.dll", dst="tests/Release", src="bin")
self.copy("*.dll", dst="demos/viewer/Debug", src="bin")
self.copy("*.dll", dst="demos/viewer/Release", src="bin")
self.copy("*.so", dst="lib", src="lib")
if self.settings.os == "Linux":
self.run("ln -s libGLEW.so lib/libGLEW.so.2.1")
...@@ -26,18 +26,18 @@ add_library(phoenix ...@@ -26,18 +26,18 @@ add_library(phoenix
${PHOENIX_SOURCES} ${PHOENIX_SOURCES}
${PHOENIX_HEADERS} ${PHOENIX_HEADERS}
) )
target_include_directories(phoenix target_include_directories(phoenix
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC ${CMAKE_CURRENT_BINARY_DIR} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}
PUBLIC ${GLEW_INCLUDE_DIRS}
PUBLIC ${OPENGL_INCLUDE_DIR} PUBLIC ${OPENGL_INCLUDE_DIR}
) )
target_link_libraries(phoenix target_link_libraries(phoenix
${CONAN_OR_CMAKE_glm} ${CONAN_OR_CMAKE_glm}
${CONAN_OR_CMAKE_SDL2} ${CONAN_OR_CMAKE_SDL2}
${CONAN_OR_CMAKE_glew}
${OPENGL_LIBRARIES} ${OPENGL_LIBRARIES}
${CONAN_OR_CMAKE_glew}
) )
generate_export_header(phoenix generate_export_header(phoenix
......
...@@ -46,13 +46,20 @@ add_test_cpplint(NAME "phoenix-tests--cpplint" ...@@ -46,13 +46,20 @@ add_test_cpplint(NAME "phoenix-tests--cpplint"
${PHOENIX_TEST_UTILITIES_HEADERS} ${PHOENIX_TEST_UTILITIES_HEADERS}
) )
#get the include directories
get_target_property(glew_include_directories
${CONAN_OR_CMAKE_glew} INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(phoenix_include_directories
phoenix INCLUDE_DIRECTORIES)
get_target_property(sdl2_include_directories
${CONAN_OR_CMAKE_SDL2} INTERFACE_INCLUDE_DIRECTORIES)
# generate opengl_mock
add_library(opengl_mock SHARED add_library(opengl_mock SHARED
src/mocks/open_gl_mock.cpp src/mocks/open_gl_mock.cpp
src/mocks/open_gl_mock.hpp src/mocks/open_gl_mock.hpp
) )
get_target_property(glew_include_directories
${CONAN_OR_CMAKE_glew} INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(opengl_mock target_include_directories(opengl_mock
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src
PUBLIC ${glew_include_directories}) PUBLIC ${glew_include_directories})
...@@ -91,9 +98,6 @@ add_test_cpplint(NAME "test_clear_pass--cpplint" ...@@ -91,9 +98,6 @@ add_test_cpplint(NAME "test_clear_pass--cpplint"
set_warning_levels_rwth(test_clear_pass) set_warning_levels_rwth(test_clear_pass)
# make shure linker dependency injection works # make shure linker dependency injection works
get_target_property(phoenix_include_directories phoenix INCLUDE_DIRECTORIES)
get_target_property(glew_include_directories
${CONAN_OR_CMAKE_glew} INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(test_clear_pass target_include_directories(test_clear_pass
PRIVATE ${phoenix_include_directories} PRIVATE ${phoenix_include_directories}
PRIVATE ${glew_include_directories} PRIVATE ${glew_include_directories}
...@@ -127,9 +131,6 @@ add_test_cpplint(NAME "test_geometry_pass--cpplint" ...@@ -127,9 +131,6 @@ add_test_cpplint(NAME "test_geometry_pass--cpplint"
set_warning_levels_rwth(test_geometry_pass) set_warning_levels_rwth(test_geometry_pass)
# make shure linker dependency injection works # make shure linker dependency injection works
get_target_property(phoenix_include_directories phoenix INCLUDE_DIRECTORIES)
get_target_property(glew_include_directories
${CONAN_OR_CMAKE_glew} INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(test_geometry_pass target_include_directories(test_geometry_pass
PRIVATE ${phoenix_include_directories} PRIVATE ${phoenix_include_directories}
PRIVATE ${glew_include_directories} PRIVATE ${glew_include_directories}
...@@ -165,10 +166,6 @@ add_test_cpplint(NAME "rendering_system--cpplint" ...@@ -165,10 +166,6 @@ add_test_cpplint(NAME "rendering_system--cpplint"
set_warning_levels_rwth(test_rendering_system) set_warning_levels_rwth(test_rendering_system)
# make shure linker dependency injection works # make shure linker dependency injection works
get_target_property(phoenix_include_directories phoenix INCLUDE_DIRECTORIES)
get_target_property(glew_include_directories
${CONAN_OR_CMAKE_glew} INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(sdl2_include_directories ${CONAN_OR_CMAKE_SDL2} INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(test_rendering_system target_include_directories(test_rendering_system
PRIVATE ${phoenix_include_directories} PRIVATE ${phoenix_include_directories}
PRIVATE ${glew_include_directories} PRIVATE ${glew_include_directories}
...@@ -206,17 +203,11 @@ add_test_cpplint(NAME "test_window--cpplint" ...@@ -206,17 +203,11 @@ add_test_cpplint(NAME "test_window--cpplint"
set_warning_levels_rwth(test_window) set_warning_levels_rwth(test_window)
# make shure linker dependency injection works # make shure linker dependency injection works
get_target_property(phoenix_include_directories__test_window phoenix INCLUDE_DIRECTORIES)
if(TARGET ${CONAN_OR_CMAKE_SDL2})
get_target_property(sdl2_include_directories__test_window ${CONAN_OR_CMAKE_SDL2} INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(test_window target_include_directories(test_window
PRIVATE ${sdl2_include_directories__test_window} PRIVATE ${phoenix_include_directories}
)
endif()
target_include_directories(test_window
PRIVATE ${phoenix_include_directories__test_window}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
PRIVATE ${CONAN_OR_CMAKE_SDL2}) PRIVATE ${CONAN_OR_CMAKE_SDL2}
PRIVATE ${sdl2_include_directories})
get_target_property(phoenix_link_libraries__test_window phoenix LINK_LIBRARIES) get_target_property(phoenix_link_libraries__test_window phoenix LINK_LIBRARIES)
list(REMOVE_ITEM phoenix_link_libraries__test_window ${CONAN_OR_CMAKE_SDL2}) list(REMOVE_ITEM phoenix_link_libraries__test_window ${CONAN_OR_CMAKE_SDL2})
......
...@@ -26,13 +26,12 @@ ...@@ -26,13 +26,12 @@
SUPPRESS_WARNINGS_BEGIN SUPPRESS_WARNINGS_BEGIN
#include "GL/glew.h" #include "GL/glew.h"
SUPPRESS_WARNINGS_END
#include "phx/geometry_pass.hpp"
#include "trompeloeil.hpp" #include "trompeloeil.hpp"
SUPPRESS_WARNINGS_END
#include "mocks/open_gl_mock.hpp" #include "mocks/open_gl_mock.hpp"
#include "phx/geometry_pass.hpp"
extern template struct trompeloeil::reporter<trompeloeil::specialized>; extern template struct trompeloeil::reporter<trompeloeil::specialized>;
...@@ -40,9 +39,9 @@ SCENARIO( ...@@ -40,9 +39,9 @@ SCENARIO(
"The geometry pass collects all vertices in one vector and draws them.", "The geometry pass collects all vertices in one vector and draws them.",
"[phx][phx::GeometryPass]") { "[phx][phx::GeometryPass]") {
OPENGL_MOCK_ALLOW_ANY_CALL OPENGL_MOCK_ALLOW_ANY_CALL
const GLuint vertex_buffer_id = 1; const GLuint vertex_buffer_id = 1u;
const GLuint normal_buffer_id = 2; const GLuint normal_buffer_id = 2u;
const GLuint index_buffer_id = 3; const GLuint index_buffer_id = 3u;
GIVEN("A geometry pass") { GIVEN("A geometry pass") {
phx::GeometryPass geometryPass; phx::GeometryPass geometryPass;
...@@ -161,7 +160,9 @@ SCENARIO( ...@@ -161,7 +160,9 @@ SCENARIO(
} }
THEN("it creates one vertex array, three buffers, and assigns them") { THEN("it creates one vertex array, three buffers, and assigns them") {
REQUIRE_CALL(open_gl_mock, glCreateVertexArrays(1, _)).TIMES(1); REQUIRE_CALL(open_gl_mock, glCreateVertexArrays(1, _))
.TIMES(1)
.SIDE_EFFECT(*_2 = 1);
trompeloeil::sequence seq; trompeloeil::sequence seq;
REQUIRE_CALL(open_gl_mock, glCreateBuffers(1, _)) REQUIRE_CALL(open_gl_mock, glCreateBuffers(1, _))
.TIMES(1) .TIMES(1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment