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

Added option NOSE_OPT to catkin_add_nosetests func #123

Merged
merged 1 commit into from
May 29, 2017
Merged
Show file tree
Hide file tree
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
12 changes: 8 additions & 4 deletions cmake/nosetests.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ _generate_function_if_testing_is_disabled("catkin_add_nosetests")
# tests (this option can only be used when the ``path`` argument is a
# file but not when it is a directory)
# :type WORKING_DIRECTORY: string
# :param NOSE_OPT: additional options to be used to run pytest, this param
# should be used only if the other ones do not fulfill you requirements to
# properly run your pytests.
#
# @public
#
Expand All @@ -34,7 +37,8 @@ function(catkin_add_nosetests path)
return()
endif()

cmake_parse_arguments(_nose "" "TIMEOUT;WORKING_DIRECTORY" "DEPENDENCIES" ${ARGN})

cmake_parse_arguments(_nose "" "TIMEOUT;WORKING_DIRECTORY;NOSE_OPT" "DEPENDENCIES" ${ARGN})
if(NOT _nose_TIMEOUT)
set(_nose_TIMEOUT 60)
endif()
Expand Down Expand Up @@ -79,8 +83,8 @@ function(catkin_add_nosetests path)
else()
set(tests "${_path_name}")
endif()
set(cmd ${cmd} "${CATKIN_ENV} ${CATKIN_PIP_NOSETESTS} -P --process-timeout=${_nose_TIMEOUT} ${tests} --with-xunit --xunit-file=${output_path}/nosetests-${output_file_name}.xml${_covarg}")
catkin_run_tests_target("nosetests" ${output_file_name} "nosetests-${output_file_name}.xml" COMMAND ${cmd} DEPENDENCIES ${_nose_DEPENDENCIES} WORKING_DIRECTORY ${_nose_WORKING_DIRECTORY})
set(cmd ${cmd} "${CATKIN_ENV} ${CATKIN_PIP_NOSETESTS} -P --process-timeout=${_nose_TIMEOUT} ${tests} ${_nose_NOSE_OPT} --with-xunit --xunit-file=${output_path}/nosetests-${output_file_name}.xml${_covarg}")
catkin_run_tests_target("nosetests" ${output_file_name} "nosetests-${output_file_name}.xml" COMMAND ${cmd} DEPENDENCIES ${_nose_DEPENDENCIES} WORKING_DIRECTORY ${_nose_WORKING_DIRECTORY})
endfunction()

# Providing another catkin nosetests usage...
Expand Down Expand Up @@ -119,4 +123,4 @@ macro(_strip_path_prefix var value prefix)
endif()
endif()
endif()
endmacro()
endmacro()
8 changes: 6 additions & 2 deletions cmake/pytest.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ _generate_function_if_testing_is_disabled("catkin_add_pytests")
# tests (this option can only be used when the ``path`` argument is a
# file but not when it is a directory)
# :type WORKING_DIRECTORY: string
# :param PYTEST_OPT: additional options to be used to run pytest, this param
# should be used only if the other ones do not fullfill you requirements to
# properly run your pytests.
# :type PYTEST_OPT: string
#
# @public
#
Expand All @@ -34,7 +38,7 @@ function(catkin_add_pytests path)
return()
endif()

cmake_parse_arguments(_pytest "" "TIMEOUT;WORKING_DIRECTORY" "DEPENDENCIES" ${ARGN})
cmake_parse_arguments(_pytest "" "TIMEOUT;WORKING_DIRECTORY;PYTEST_OPT" "DEPENDENCIES" ${ARGN})
if(NOT _pytest_TIMEOUT)
set(_pytest_TIMEOUT 60)
endif()
Expand Down Expand Up @@ -74,7 +78,7 @@ function(catkin_add_pytests path)
get_filename_component(output_path "${output_path}" ABSOLUTE)
set(cmd "${CMAKE_COMMAND} -E make_directory ${output_path}")
set(tests "${_path_name}")
set(cmd ${cmd} "${CATKIN_ENV} ${CATKIN_PIP_PYTEST} --timeout=${_pytest_TIMEOUT} ${tests} --junit-xml ${output_path}/pytests-${output_file_name}.xml ${_covarg}")
set(cmd ${cmd} "${CATKIN_ENV} ${CATKIN_PIP_PYTEST} --timeout=${_pytest_TIMEOUT} ${tests} ${_pytest_PYTEST_OPT} --junit-xml ${output_path}/pytests-${output_file_name}.xml ${_covarg}")
catkin_run_tests_target("pytests" ${output_file_name} "pytests-${output_file_name}.xml" COMMAND ${cmd} DEPENDENCIES ${_pytest_DEPENDENCIES} WORKING_DIRECTORY ${_pytest_WORKING_DIRECTORY})
endfunction()

Expand Down