forked from qt-creator/qt-creator
CMake Build: Fix CMake configuration when BUILD_WITH_TESTS=ON
The GMock/GTest unittest was not working with the latest translation patches. Change-Id: I83e337c6278cb93344c734c05d090a65def34a3b Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
Tobias Hunger
parent
a33cb335f7
commit
f275a1fa28
@@ -201,7 +201,10 @@ function(set_public_includes target includes)
|
|||||||
endforeach()
|
endforeach()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(fix_test_environment test_name)
|
function(finalize_test_setup test_name)
|
||||||
|
# Never translate tests:
|
||||||
|
set_tests_properties(${name} PROPERTIES QT_SKIP_TRANSLATION ON)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
list(APPEND env_path $ENV{PATH})
|
list(APPEND env_path $ENV{PATH})
|
||||||
list(APPEND env_path ${CMAKE_BINARY_DIR}/${IDE_PLUGIN_PATH})
|
list(APPEND env_path ${CMAKE_BINARY_DIR}/${IDE_PLUGIN_PATH})
|
||||||
@@ -828,11 +831,8 @@ function(add_qtc_test name)
|
|||||||
|
|
||||||
if (NOT _arg_GTEST)
|
if (NOT _arg_GTEST)
|
||||||
add_test(NAME ${name} COMMAND ${name})
|
add_test(NAME ${name} COMMAND ${name})
|
||||||
fix_test_environment(${name})
|
finalize_test_setup(${name})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Never translate tests:
|
|
||||||
set_tests_properties(${name} PROPERTIES QT_SKIP_TRANSLATION ON)
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(finalize_qtc_gtest test_name)
|
function(finalize_qtc_gtest test_name)
|
||||||
@@ -841,6 +841,6 @@ function(finalize_qtc_gtest test_name)
|
|||||||
gtest_add_tests(TARGET ${test_name} SOURCES ${test_sources} TEST_LIST test_list)
|
gtest_add_tests(TARGET ${test_name} SOURCES ${test_sources} TEST_LIST test_list)
|
||||||
|
|
||||||
foreach(test IN LISTS test_list)
|
foreach(test IN LISTS test_list)
|
||||||
fix_test_environment(${test})
|
finalize_test_setup(${test})
|
||||||
endforeach()
|
endforeach()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
Reference in New Issue
Block a user