Skip to content

Commit

Permalink
wrap coverage/python-coverage script
Browse files Browse the repository at this point in the history
  • Loading branch information
wjwwood committed Apr 21, 2014
1 parent b76c483 commit 551e274
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 17 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ include = *src/capabilities*
endef
export COVERAGERC

COVERAGE_BIN=${SRC_DIR}/test/run_coverage

coverage:
@echo "Using SRC_DIR: ${SRC_DIR}"
@echo "Using BUILD_DIR: ${BUILD_DIR}"
Expand All @@ -28,5 +30,5 @@ coverage:
cd ${BUILD_DIR} && ${BUILD_DIR}/devel/env.sh nosetests --where=${SRC_DIR}/test/unit --with-coverage -s
ls ${BUILD_DIR}/.coverage
cp ${BUILD_DIR}/.coverage ./.coverage.2
coverage combine
coverage report --include='*capabilities/src*' -m
${COVERAGE_BIN} combine
${COVERAGE_BIN} report --include='*capabilities/src*' -m
2 changes: 1 addition & 1 deletion test/rostest/test_client/test_client_module.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<env name="ROS_PACKAGE_PATH"
value="$(find capabilities)/test/unit/discovery_workspaces/minimal:$(env ROS_PACKAGE_PATH)" />
</node>
<test test-name="client_module" pkg="capabilities" type="test_client_module.py" launch-prefix="coverage run --source=$(find capabilities)/src/capabilities --append "/>
<test test-name="client_module" pkg="capabilities" type="test_client_module.py" launch-prefix="$(find capabilities)/test/run_coverage run --source=$(find capabilities)/src/capabilities --append "/>
</launch>
2 changes: 1 addition & 1 deletion test/rostest/test_launch_manager/test_launch_manager.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<launch>
<test test-name="launch_manager" pkg="capabilities" type="test_launch_manager.py"
launch-prefix="coverage run --append " time-limit="360.0" />
launch-prefix="$(find capabilities)/test/run_coverage run --append " time-limit="360.0" />
</launch>
2 changes: 1 addition & 1 deletion test/rostest/test_server/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def wait_for_result_to_happen(expected, initial_result, tries=10, sleep_period=1

class Test(unittest.TestCase):
def test_use_and_free_capability(self):
wait_for_capability_server(3)
assert wait_for_capability_server(10)
c = CapabilitiesClient()
c.wait_for_services(timeout=3.0)
# Give invalid bond id to use_capability
Expand Down
2 changes: 1 addition & 1 deletion test/rostest/test_server/test_client.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<launch>
<node pkg="capabilities" name="capability_server" type="capability_server" output="screen" required="true"
launch-prefix="coverage run --append ">
launch-prefix="$(find capabilities)/test/run_coverage run --append ">
<param name="debug" value="true"/>
<env name="ROS_PACKAGE_PATH"
value="$(find capabilities)/test/unit/discovery_workspaces/minimal:$(env ROS_PACKAGE_PATH)" />
Expand Down
2 changes: 1 addition & 1 deletion test/rostest/test_server/test_default_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class Test(unittest.TestCase):
def test_default_provider(self):
wait_for_capability_server(None)
assert wait_for_capability_server(10)
call_service('/capability_server/start_capability', 'no_default_provider_pkg/Minimal', '')
rospy.sleep(1) # Wait for the system to settle
resp = call_service('/capability_server/get_running_capabilities')
Expand Down
2 changes: 1 addition & 1 deletion test/rostest/test_server/test_default_provider.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<launch>
<node pkg="capabilities" name="capability_server" type="capability_server" output="screen" required="true"
launch-prefix="coverage run --append ">
launch-prefix="$(find capabilities)/test/run_coverage run --append ">
<param name="debug" value="true"/>
<env name="ROS_PACKAGE_PATH"
value="$(find capabilities)/test/rostest/test_server/no_default_provider:$(find capabilities)/test/unit/discovery_workspaces/minimal:$(env ROS_PACKAGE_PATH)" />
Expand Down
4 changes: 2 additions & 2 deletions test/rostest/test_server/test_dependent_capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class Test(unittest.TestCase):
def test_start_stop_dependent_capabilities(self):
wait_for_capability_server(3)
wait_for_capability_server(10)
call_service('/capability_server/start_capability',
'navigation_capability/Navigation',
'navigation_capability/faux_navigation')
Expand Down Expand Up @@ -51,7 +51,7 @@ def test_stop_base_capability(self):
"""
Stopping a base capability should stop all dependent capabilities too.
"""
wait_for_capability_server(3)
wait_for_capability_server(10)
call_service('/capability_server/start_capability',
'navigation_capability/Navigation',
'navigation_capability/faux_navigation')
Expand Down
2 changes: 1 addition & 1 deletion test/rostest/test_server/test_dependent_capabilities.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<launch>
<node pkg="capabilities" name="capability_server" type="capability_server" output="screen" required="true"
launch-prefix="coverage run --append ">
launch-prefix="$(find capabilities)/test/run_coverage run --append ">
<param name="debug" value="true"/>
<env name="ROS_PACKAGE_PATH"
value="$(find capabilities)/test/rostest/test_server/dependent_capabilities:$(find capabilities)/test/unit/discovery_workspaces/minimal:$(env ROS_PACKAGE_PATH)" />
Expand Down
2 changes: 1 addition & 1 deletion test/rostest/test_server/test_invalid_specs.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<launch>
<test test-name="invalid_specs" pkg="capabilities" type="test_invalid_specs.py"
launch-prefix="coverage run --append " />
launch-prefix="$(find capabilities)/test/run_coverage run --append " />
</launch>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<launch>
<node pkg="capabilities" name="capability_server" type="capability_server" output="screen" required="true"
launch-prefix="coverage run --append ">
launch-prefix="$(find capabilities)/test/run_coverage run --append ">
<param name="debug" value="true"/>
<env name="ROS_PACKAGE_PATH"
value="$(find capabilities)/test/unit/discovery_workspaces/minimal:$(find capabilities)/test/rostest/test_server/dependent_capabilities:$(env ROS_PACKAGE_PATH)" />
Expand Down
2 changes: 1 addition & 1 deletion test/rostest/test_server/test_remapping.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<launch>
<node pkg="capabilities" name="capability_server" type="capability_server" output="screen" required="true"
launch-prefix="coverage run --append ">
launch-prefix="$(find capabilities)/test/run_coverage run --append ">
<param name="debug" value="true"/>
<env name="ROS_PACKAGE_PATH"
value="$(find capabilities)/test/unit/discovery_workspaces/remapping_examples:$(env ROS_PACKAGE_PATH)" />
Expand Down
2 changes: 1 addition & 1 deletion test/rostest/test_server/test_ros_services.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<launch>
<node pkg="capabilities" name="capability_server" type="capability_server" output="screen" required="true"
launch-prefix="coverage run --append ">
launch-prefix="$(find capabilities)/test/run_coverage run --append ">
<param name="debug" value="true"/>
<env name="ROS_PACKAGE_PATH"
value="$(find capabilities)/test/unit/discovery_workspaces/minimal:$(find capabilities)/test/rostest/test_server/no_provider:$(env ROS_PACKAGE_PATH)" />
Expand Down
2 changes: 1 addition & 1 deletion test/rostest/test_server/test_white_black_lists.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<launch>
<node pkg="capabilities" name="capability_server" type="capability_server" output="screen" required="true"
launch-prefix="coverage run --append ">
launch-prefix="$(find capabilities)/test/run_coverage run --append ">
<param name="debug" value="true"/>
<env name="ROS_PACKAGE_PATH"
value="$(find capabilities)/test/unit/discovery_workspaces/minimal:$(find capabilities)/test/rostest/test_server/dependent_capabilities:$(env ROS_PACKAGE_PATH)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<env name="ROS_PACKAGE_PATH"
value="$(find capabilities)/test/unit/discovery_workspaces/minimal:$(env ROS_PACKAGE_PATH)" />
</node>
<test test-name="spec_index_from_service" pkg="capabilities" type="test_spec_index_from_service.py" launch-prefix="coverage run --source=$(find capabilities)/src/capabilities --append "/>
<test test-name="spec_index_from_service" pkg="capabilities" type="test_spec_index_from_service.py" launch-prefix="$(find capabilities)/test/run_coverage run --source=$(find capabilities)/src/capabilities --append "/>
</launch>
7 changes: 7 additions & 0 deletions test/run_coverage
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python

import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
sys.exit(load_entry_point('coverage', 'console_scripts', 'coverage')())

0 comments on commit 551e274

Please sign in to comment.