From 6e31af3923601663b351433892d6ad314fdc802a Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Sun, 17 Nov 2013 18:07:18 +0100 Subject: Initialise CSystemUtils' singleton in the three light, transform and model tests Also fix README --- test/envs/opengl/README.txt | 2 +- test/envs/opengl/light_test.cpp | 3 +++ test/envs/opengl/model_test.cpp | 5 ++++- test/envs/opengl/transform_test.cpp | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test/envs/opengl/README.txt b/test/envs/opengl/README.txt index c618415..f64f185 100644 --- a/test/envs/opengl/README.txt +++ b/test/envs/opengl/README.txt @@ -1,7 +1,7 @@ Test programs for OpenGL engine: - texture_test -> multitexturing test with 2 textures (included as files: ./tex1.png, ./tex2.png) - model_test -> simple model viewer to test model loading - usage: ./model_test {dxf|mod} model_file + usage: ./model_test {old|new_txt|new_bin} model_file second argument is the loaded format (DXF or Colobot .mod files) requires ./tex folder (or symlink) with Colobot textures viewer is controlled from keyboard - the bindings can be found in code diff --git a/test/envs/opengl/light_test.cpp b/test/envs/opengl/light_test.cpp index 0baf6d3..227ca2a 100644 --- a/test/envs/opengl/light_test.cpp +++ b/test/envs/opengl/light_test.cpp @@ -365,6 +365,9 @@ int SDL_MAIN_FUNC(int argc, char *argv[]) { CLogger logger; + CSystemUtils* systemUtils = CSystemUtils::Create(); // platform-specific utils + systemUtils->Init(); + PREV_TIME = GetSystemUtils()->CreateTimeStamp(); CURR_TIME = GetSystemUtils()->CreateTimeStamp(); diff --git a/test/envs/opengl/model_test.cpp b/test/envs/opengl/model_test.cpp index 1dda69c..fa4042c 100644 --- a/test/envs/opengl/model_test.cpp +++ b/test/envs/opengl/model_test.cpp @@ -265,6 +265,9 @@ int SDL_MAIN_FUNC(int argc, char *argv[]) { CLogger logger; + CSystemUtils* systemUtils = CSystemUtils::Create(); // platform-specific utils + systemUtils->Init(); + PREV_TIME = GetSystemUtils()->CreateTimeStamp(); CURR_TIME = GetSystemUtils()->CreateTimeStamp(); @@ -273,7 +276,7 @@ int SDL_MAIN_FUNC(int argc, char *argv[]) if (argc != 3) { - std::cerr << "Usage: " << argv[0] << "{old|new_txt|new_bin} model_file" << std::endl; + std::cerr << "Usage: " << argv[0] << " {old|new_txt|new_bin} model_file" << std::endl; return 1; } diff --git a/test/envs/opengl/transform_test.cpp b/test/envs/opengl/transform_test.cpp index 1d5ccf1..58d8e9e 100644 --- a/test/envs/opengl/transform_test.cpp +++ b/test/envs/opengl/transform_test.cpp @@ -243,6 +243,9 @@ int SDL_MAIN_FUNC(int argc, char *argv[]) { CLogger logger; + CSystemUtils* systemUtils = CSystemUtils::Create(); // platform-specific utils + systemUtils->Init(); + PREV_TIME = GetSystemUtils()->CreateTimeStamp(); CURR_TIME = GetSystemUtils()->CreateTimeStamp(); -- cgit v1.2.3-1-g7c22 From ca82353e81988b4c4105ef2ed8d61206a70d6595 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Mon, 18 Nov 2013 16:13:19 +0100 Subject: Re-enable profile_test test --- test/unit/common/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/unit/common/CMakeLists.txt b/test/unit/common/CMakeLists.txt index aebf17a..7d1ae9d 100644 --- a/test/unit/common/CMakeLists.txt +++ b/test/unit/common/CMakeLists.txt @@ -10,7 +10,10 @@ target_link_libraries(image_test ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY} ${PNG_LIBRAR file(COPY colobot.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -# add_executable(profile_test ${SRC_DIR}/common/profile.cpp ${SRC_DIR}/common/logger.cpp profile_test.cpp) -# target_link_libraries(profile_test gtest ${Boost_LIBRARIES}) +add_executable(profile_test ${SRC_DIR}/common/profile.cpp ${SRC_DIR}/common/logger.cpp profile_test.cpp) +set_target_properties(profile_test PROPERTIES COMPILE_DEFINITIONS "DEV_BUILD=1") +target_link_libraries(profile_test gtest ${Boost_LIBRARIES}) -# add_test(profile_test ./profile_test) +add_test(NAME profile_test + COMMAND ${CMAKE_BINARY_DIR}/profile_test + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) -- cgit v1.2.3-1-g7c22 From 86c0eb193dc84d39056e9a581f0717a058614db1 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Mon, 18 Nov 2013 16:24:41 +0100 Subject: Run image_test --- test/unit/common/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/unit/common/CMakeLists.txt b/test/unit/common/CMakeLists.txt index 7d1ae9d..cf37961 100644 --- a/test/unit/common/CMakeLists.txt +++ b/test/unit/common/CMakeLists.txt @@ -7,6 +7,8 @@ ${GTEST_INCLUDE_DIR} add_executable(image_test ${SRC_DIR}/common/image.cpp image_test.cpp) target_link_libraries(image_test ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY} ${PNG_LIBRARIES}) +add_test(NAME image_test + COMMAND ${CMAKE_BINARY_DIR}/image_test ${CMAKE_SOURCE_DIR}/test/envs/opengl/tex1.png ${CMAKE_BINARY_DIR}/tex1_test.png) file(COPY colobot.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -- cgit v1.2.3-1-g7c22