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
Branches
Tags
2 merge requests!19Release/v17.09.0,!17Feature/#69 open gl mock failing msvs
......@@ -173,7 +173,6 @@ test:linux:gcc4.9.2:
script:
- cd build
- make test
test:linux:gcc5.3.1:
stage: test
tags:
......
......@@ -25,6 +25,7 @@ project(ProjectPhoenix)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(CMAKE_CXX_STANDARD 14)
link_directories(${CMAKE_CURRENT_BINARY_DIR}/lib)
# needs to be first since other scripts might rely on this
include(ConanHelpers)
......
......@@ -36,7 +36,7 @@ function(CONFIGURE_MSVC_USERFILE TARGET_NAME PATH_TO_ADD)
"${CMAKE_SOURCE_DIR}/cmake/VisualStudio2013.vcxproj.user.in")
set(DESTINATION_USER_FILE
"${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)
endfunction()
......
......@@ -34,3 +34,20 @@ class ProjectPhoenix(ConanFile):
("SDL2/2.0.5@RWTH-VR/thirdparty"),
("trompeloeil/v25@rollbear/stable")) # comma separated list of requirements
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
${PHOENIX_SOURCES}
${PHOENIX_HEADERS}
)
target_include_directories(phoenix
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}
PUBLIC ${GLEW_INCLUDE_DIRS}
PUBLIC ${OPENGL_INCLUDE_DIR}
)
target_link_libraries(phoenix
${CONAN_OR_CMAKE_glm}
${CONAN_OR_CMAKE_SDL2}
${CONAN_OR_CMAKE_glew}
${OPENGL_LIBRARIES}
${CONAN_OR_CMAKE_glew}
)
generate_export_header(phoenix
......
......@@ -46,13 +46,20 @@ add_test_cpplint(NAME "phoenix-tests--cpplint"
${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
src/mocks/open_gl_mock.cpp
src/mocks/open_gl_mock.hpp
)
get_target_property(glew_include_directories
${CONAN_OR_CMAKE_glew} INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(opengl_mock
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src
PUBLIC ${glew_include_directories})
......@@ -91,9 +98,6 @@ add_test_cpplint(NAME "test_clear_pass--cpplint"
set_warning_levels_rwth(test_clear_pass)
# 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
PRIVATE ${phoenix_include_directories}
PRIVATE ${glew_include_directories}
......@@ -127,9 +131,6 @@ add_test_cpplint(NAME "test_geometry_pass--cpplint"
set_warning_levels_rwth(test_geometry_pass)
# 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
PRIVATE ${phoenix_include_directories}
PRIVATE ${glew_include_directories}
......@@ -165,10 +166,6 @@ add_test_cpplint(NAME "rendering_system--cpplint"
set_warning_levels_rwth(test_rendering_system)
# 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
PRIVATE ${phoenix_include_directories}
PRIVATE ${glew_include_directories}
......@@ -206,17 +203,11 @@ add_test_cpplint(NAME "test_window--cpplint"
set_warning_levels_rwth(test_window)
# 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
PRIVATE ${sdl2_include_directories__test_window}
)
endif()
target_include_directories(test_window
PRIVATE ${phoenix_include_directories__test_window}
PRIVATE ${phoenix_include_directories}
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)
list(REMOVE_ITEM phoenix_link_libraries__test_window ${CONAN_OR_CMAKE_SDL2})
......
......@@ -26,13 +26,12 @@
SUPPRESS_WARNINGS_BEGIN
#include "GL/glew.h"
SUPPRESS_WARNINGS_END
#include "phx/geometry_pass.hpp"
#include "trompeloeil.hpp"
SUPPRESS_WARNINGS_END
#include "mocks/open_gl_mock.hpp"
#include "phx/geometry_pass.hpp"
extern template struct trompeloeil::reporter<trompeloeil::specialized>;
......@@ -40,9 +39,9 @@ SCENARIO(
"The geometry pass collects all vertices in one vector and draws them.",
"[phx][phx::GeometryPass]") {
OPENGL_MOCK_ALLOW_ANY_CALL
const GLuint vertex_buffer_id = 1;
const GLuint normal_buffer_id = 2;
const GLuint index_buffer_id = 3;
const GLuint vertex_buffer_id = 1u;
const GLuint normal_buffer_id = 2u;
const GLuint index_buffer_id = 3u;
GIVEN("A geometry pass") {
phx::GeometryPass geometryPass;
......@@ -161,7 +160,9 @@ SCENARIO(
}
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;
REQUIRE_CALL(open_gl_mock, glCreateBuffers(1, _))
.TIMES(1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment