This is an automated email from the ASF dual-hosted git repository.

kgiusti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/master by this push:
     new fd9dcee  DISPATCH-1528: fix cmake script that finds the tox tool
fd9dcee is described below

commit fd9dceeac69b756fcf73d335ad3ee203bb092520
Author: Kenneth Giusti <[email protected]>
AuthorDate: Tue Dec 17 11:11:37 2019 -0500

    DISPATCH-1528: fix cmake script that finds the tox tool
    
    This closes #650
---
 tests/CMakeLists.txt | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 18e6e5b..8fee36f 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -153,12 +153,15 @@ endforeach()
 #
 find_program(TOX_EXE "tox")
 if (TOX_EXE)
+  # the "skip_install" feature showed up in version 1.9.0 tox,
+  # which is used by our tox.ini script:
   set(TOX_MIN_VERSION 1.9.0)
-  execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import tox, sys; print('%s' 
% tox.__version__); sys.exit(0)"
+  execute_process(COMMAND "${TOX_EXE}" "--version"
                   RESULT_VARIABLE TOX_STATUS
                   OUTPUT_VARIABLE TOX_VERSION)
   if (TOX_STATUS EQUAL 0)
-    string(STRIP ${TOX_VERSION} TOX_VERSION)
+    string(STRIP "${TOX_VERSION}" TOX_VERSION)
+    string(REGEX MATCH "^[0-9][.][0-9][.][0-9]" TOX_VERSION "${TOX_VERSION}")
     if (TOX_VERSION STRLESS TOX_MIN_VERSION)
       message( STATUS "tox version ${TOX_VERSION} < required version 
${TOX_MIN_VERSION} - skipping python-checker")
     else (TOX_VERSION STRLESS TOX_MIN_VERSION)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to