mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-06 22:30:07 -05:00
Tests: Improve FindRuby test robustness
This commit is contained in:
@@ -24,7 +24,7 @@ if(CMake_TEST_FindRuby)
|
||||
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
|
||||
)
|
||||
set_tests_properties(FindRuby.Fail PROPERTIES
|
||||
PASS_REGULAR_EXPRESSION "Could NOT find Ruby.*(Required is at least version \"[0-9]+\\.[0-9]+\\.[0-9]+\")")
|
||||
PASS_REGULAR_EXPRESSION "Could NOT find Ruby.*(Required[ \n]+is[ \n]+at[ \n]+least[ \n]+version[ \n]*\"[0-9]+\\.[0-9]+\\.[0-9]+\")")
|
||||
|
||||
# Looks for 1.9.9 EXACTLY, which unlike the "FindRuby" test above will fail on every machine
|
||||
# since this version doesn't exist (ruby goes from 1.9.3 to 2.0.0)
|
||||
|
||||
@@ -23,7 +23,7 @@ if (result)
|
||||
message (FATAL_ERROR "Unable to detect RVM ruby version from `${MY_RUBY_HOME}/bin/ruby`: ${RVM_RUBY_VERSION}")
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E env --unset=MY_RUBY_HOME --unset=PATH
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E env --unset=MY_RUBY_HOME PATH=/usr/bin:/bin
|
||||
"which" "ruby"
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE SYSTEM_RUBY
|
||||
|
||||
Reference in New Issue
Block a user