Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support using nosetests with Python3 #593

Merged
merged 1 commit into from
Feb 14, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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