You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gm...@apache.org on 2018/01/30 14:09:33 UTC

qpid-dispatch git commit: DISPATCH-919: if python-unittest2 not installed issue warning and disable tests

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master b08d98165 -> fe8e38bfb


DISPATCH-919: if python-unittest2 not installed issue warning and disable tests


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/fe8e38bf
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/fe8e38bf
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/fe8e38bf

Branch: refs/heads/master
Commit: fe8e38bfb602fd6c6f628407421f0a51a22eb0c2
Parents: b08d981
Author: ganeshmurthy <gm...@redhat.com>
Authored: Mon Jan 29 13:36:50 2018 -0500
Committer: Ganesh Murthy <gm...@redhat.com>
Committed: Tue Jan 30 09:08:29 2018 -0500

----------------------------------------------------------------------
 CMakeLists.txt | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/fe8e38bf/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 34e27b7..55c6e5f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,8 +45,19 @@ include(CheckIncludeFiles)
 include(FindPythonInterp)
 include(FindPythonLibs)
 
+# Find python-unittest2
+execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "import unittest2"
+			RESULT_VARIABLE UNITTEST2_MISSING
+			ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
 enable_testing()
-include (CTest)
+if(UNITTEST2_MISSING)
+  message(STATUS "WARNING: python-unittest2 is not installed. ***unit tests cannot be run***" )
+  # add bogus test for folk who may have missed the cmake warning
+  add_test(WARNING_python_unittest2_module_NOT_INSTALLED false)
+else(UNITTEST2_MISSING)
+  include (CTest)
+endif(UNITTEST2_MISSING)
+
 
 if (NOT PYTHONLIBS_FOUND)
      message(FATAL_ERROR "Python Development Libraries are needed.")
@@ -218,7 +229,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/run.py.in ${CMAKE_CURRENT_BINARY_DIR}
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/run.py.in ${CMAKE_CURRENT_BINARY_DIR}/tests/run.py)
 execute_process(COMMAND ${RUN} --sh OUTPUT_FILE config.sh)
 
-add_subdirectory(tests)
+if (NOT UNITTEST2_MISSING)
+  add_subdirectory(tests)
+endif(NOT UNITTEST2_MISSING)
 add_subdirectory(python)
 add_subdirectory(router)
 add_subdirectory(doc)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org