summaryrefslogtreecommitdiffstats
path: root/Tests/FindRuby
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-02 14:09:38 (GMT)
committerBrad King <brad.king@kitware.com>2020-10-05 12:57:10 (GMT)
commitd77f8117cb3999469da3891ae91cc9389784681a (patch)
tree4b2c53a24460d3fb00459fe2e159fd79b4775473 /Tests/FindRuby
parentb1898bf97570b2887f7398105231ff72adb1564d (diff)
downloadCMake-d77f8117cb3999469da3891ae91cc9389784681a.zip
CMake-d77f8117cb3999469da3891ae91cc9389784681a.tar.gz
CMake-d77f8117cb3999469da3891ae91cc9389784681a.tar.bz2
Tests: Improve FindRuby test robustness
Diffstat (limited to 'Tests/FindRuby')
-rw-r--r--Tests/FindRuby/CMakeLists.txt2
-rw-r--r--Tests/FindRuby/Rvm/CMakeLists.txt2
2 files changed, 2 insertions, 2 deletions
diff --git a/Tests/FindRuby/CMakeLists.txt b/Tests/FindRuby/CMakeLists.txt
index 3f4807c..ee58923 100644
--- a/Tests/FindRuby/CMakeLists.txt
+++ b/Tests/FindRuby/CMakeLists.txt
@@ -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)
diff --git a/Tests/FindRuby/Rvm/CMakeLists.txt b/Tests/FindRuby/Rvm/CMakeLists.txt
index 545fc94..14bdbec 100644
--- a/Tests/FindRuby/Rvm/CMakeLists.txt
+++ b/Tests/FindRuby/Rvm/CMakeLists.txt
@@ -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