Skip to content

Commit

Permalink
Merge pull request #593 from ros/nosetests_py3
Browse files Browse the repository at this point in the history
support using nosetests with Python3
  • Loading branch information
dirk-thomas committed Feb 14, 2014
2 parents 72141df + 349cba1 commit ce2ea74
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions cmake/test/nosetests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,20 @@ function(catkin_add_nosetests path)
catkin_run_tests_target("nosetests" ${output_file_name} "nosetests-${output_file_name}.xml" COMMAND ${cmd} DEPENDENCIES ${_nose_DEPENDENCIES} WORKING_DIRECTORY ${_nose_WORKING_DIRECTORY})
endfunction()

find_program(NOSETESTS nosetests)
if(NOT nosetests_path)
# retry with name including major version number
find_program(NOSETESTS NAMES nosetests2 nosetests-2)
endif()
if(NOT NOSETESTS)
message(WARNING "nosetests not found, Python tests can not be run (try installing package 'python-nose')")
find_program(NOSETESTS NAMES
"nosetests${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}"
"nosetests-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}"
"nosetests${PYTHON_VERSION_MAJOR}"
"nosetests-${PYTHON_VERSION_MAJOR}"
"nosetests")
if(NOSETESTS)
message(STATUS "Using Python nosetests: ${NOSETESTS}")
else()
if("${PYTHON_VERSION_MAJOR}" STREQUAL "3")
message(WARNING "nosetests not found, Python tests can not be run (try installing package 'python3-nose')")
else()
message(WARNING "nosetests not found, Python tests can not be run (try installing package 'python-nose')")
endif()
endif()

macro(_strip_path_prefix var value prefix)
Expand Down

0 comments on commit ce2ea74

Please sign in to comment.