diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt index 18879427..1fc11e78 100644 --- a/googlemock/CMakeLists.txt +++ b/googlemock/CMakeLists.txt @@ -138,20 +138,6 @@ if (gmock_build_tests) # 'make test' or ctest. enable_testing() - if (WIN32) - file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$/RunTest.ps1" - CONTENT -"$project_bin = \"${CMAKE_BINARY_DIR}/bin/$\" -$env:Path = \"$project_bin;$env:Path\" -& $args") - elseif (MINGW OR CYGWIN) - file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/RunTest.ps1" - CONTENT -"$project_bin = (cygpath --windows ${CMAKE_BINARY_DIR}/bin) -$env:Path = \"$project_bin;$env:Path\" -& $args") - endif() - if (MINGW OR CYGWIN) if (CMAKE_VERSION VERSION_LESS "2.8.12") add_compile_options("-Wa,-mbig-obj") diff --git a/googletest/CMakeLists.txt b/googletest/CMakeLists.txt index cf63c602..5e546ece 100644 --- a/googletest/CMakeLists.txt +++ b/googletest/CMakeLists.txt @@ -184,20 +184,6 @@ if (gtest_build_tests) # 'make test' or ctest. enable_testing() - if (WIN32) - file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$/RunTest.ps1" - CONTENT -"$project_bin = \"${CMAKE_BINARY_DIR}/bin/$\" -$env:Path = \"$project_bin;$env:Path\" -& $args") - elseif (MINGW OR CYGWIN) - file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/RunTest.ps1" - CONTENT -"$project_bin = (cygpath --windows ${CMAKE_BINARY_DIR}/bin) -$env:Path = \"$project_bin;$env:Path\" -& $args") - endif() - ############################################################ # C++ tests built with standard compiler flags. diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake index b3e8b819..2a05f01d 100644 --- a/googletest/cmake/internal_utils.cmake +++ b/googletest/cmake/internal_utils.cmake @@ -252,13 +252,7 @@ find_package(PythonInterp) # from the given source files with the given compiler flags. function(cxx_test_with_flags name cxx_flags libs) cxx_executable_with_flags(${name} "${cxx_flags}" "${libs}" ${ARGN}) - if (WIN32 OR MINGW) - add_test(NAME ${name} - COMMAND "powershell" "-Command" "${CMAKE_CURRENT_BINARY_DIR}/$/RunTest.ps1" "$") - else() - add_test(NAME ${name} - COMMAND "$") - endif() + add_test(NAME ${name} COMMAND "$") endfunction() # cxx_test(name libs srcs...) @@ -282,45 +276,24 @@ function(py_test name) # Multi-configuration build generators as for Visual Studio save # output in a subdirectory of CMAKE_CURRENT_BINARY_DIR (Debug, # Release etc.), so we have to provide it here. - if (WIN32 OR MINGW) - add_test(NAME ${name} - COMMAND powershell -Command ${CMAKE_CURRENT_BINARY_DIR}/$/RunTest.ps1 - ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py + add_test(NAME ${name} + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py --build_dir=${CMAKE_CURRENT_BINARY_DIR}/$ ${ARGN}) - else() - add_test(NAME ${name} - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py - --build_dir=${CMAKE_CURRENT_BINARY_DIR}/$ ${ARGN}) - endif() else (CMAKE_CONFIGURATION_TYPES) # Single-configuration build generators like Makefile generators # don't have subdirs below CMAKE_CURRENT_BINARY_DIR. - if (WIN32 OR MINGW) - add_test(NAME ${name} - COMMAND powershell -Command ${CMAKE_CURRENT_BINARY_DIR}/RunTest.ps1 - ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py - --build_dir=${CMAKE_CURRENT_BINARY_DIR} ${ARGN}) - else() - add_test(NAME ${name} - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py - --build_dir=${CMAKE_CURRENT_BINARY_DIR} ${ARGN}) - endif() + add_test(NAME ${name} + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py + --build_dir=${CMAKE_CURRENT_BINARY_DIR} ${ARGN}) endif (CMAKE_CONFIGURATION_TYPES) else() # ${CMAKE_CURRENT_BINARY_DIR} is known at configuration time, so we can # directly bind it from cmake. ${CTEST_CONFIGURATION_TYPE} is known # only at ctest runtime (by calling ctest -c ), so # we have to escape $ to delay variable substitution here. - if (WIN32 OR MINGW) - add_test(NAME ${name} - COMMAND powershell -Command ${CMAKE_CURRENT_BINARY_DIR}/RunTest.ps1 - ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py - --build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE} ${ARGN}) - else() - add_test(NAME ${name} - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py - --build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE} ${ARGN}) - endif() + add_test(NAME ${name} + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py + --build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE} ${ARGN}) endif() endif(PYTHONINTERP_FOUND) endfunction()