Skip to content

Commit

Permalink
roslaunch: moving launch files to subdir
Browse files Browse the repository at this point in the history
  • Loading branch information
kwc committed Jan 7, 2012
1 parent 0bac94e commit 964da45
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 9 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions tools/roslaunch/test/unit/test_roslaunch_parent.py
Expand Up @@ -38,6 +38,7 @@

from xmlrpclib import ServerProxy

import rospkg
import rosgraph.network
import roslaunch.parent

Expand Down Expand Up @@ -142,9 +143,8 @@ def _subroslaunchParent(self):
self.assertEquals(True, p.is_core)
self.assertEquals(False, p.local_only)

import roslib.packages
rl_dir = roslib.packages.get_pkg_dir('roslaunch')
rl_file = os.path.join(rl_dir, 'example.launch')
rl_dir = rospkg.RosPack().get_path('roslaunch')
rl_file = os.path.join(rl_dir, 'resources', 'example.launch')
self.assert_(os.path.isfile(rl_file))

# validate load_config logic
Expand Down Expand Up @@ -176,7 +176,7 @@ def _subroslaunchParent(self):
except roslaunch.core.RLException: pass

# try again with bad xml
rl_dir = roslib.packages.get_pkg_dir('roslaunch')
rl_dir = rospkg.RosPack.get_path('roslaunch')
rl_file = os.path.join(rl_dir, 'test', 'xml', 'test-params-invalid-1.xml')
self.assert_(os.path.isfile(rl_file))
p = ROSLaunchParent(run_id, [rl_file])
Expand Down
6 changes: 5 additions & 1 deletion tools/roslaunch/test/unit/test_roslaunch_rlutil.py
Expand Up @@ -44,14 +44,18 @@ def get_test_path():
# two directories up from here
return os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))

# path to example.launch directory
def get_example_path():
return os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'resources'))

## Test roslaunch.node_args
class TestRoslaunchRlutil(unittest.TestCase):

def test_resolve_launch_arguments(self):
from roslaunch.rlutil import resolve_launch_arguments

roslaunch_dir = get_test_path()
example_xml_p = os.path.join(roslaunch_dir, 'example.launch')
example_xml_p = os.path.join(get_example_path(), 'example.launch')
tests = [
([], []),
(['roslaunch', 'example.launch'], [example_xml_p]),
Expand Down
2 changes: 1 addition & 1 deletion tools/roslaunch/test/unit/test_xmlloader.py
Expand Up @@ -43,7 +43,7 @@ def get_test_path():

# path to example.launch directory
def get_example_path():
return os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
return os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'resources'))

## Fake RosLaunch object
class RosLaunchMock(object):
Expand Down
6 changes: 3 additions & 3 deletions tools/roslaunch/test/xml/test-params-valid.xml
Expand Up @@ -26,11 +26,11 @@
</group>

<!-- upload the contents of a file as a param -->
<param name="configfile" textfile="$(find roslaunch)/example.launch" />
<param name="configfile" textfile="$(find roslaunch)/resources/example.launch" />
<!-- upload the contents of a file as base64 binary as a param -->
<param name="binaryfile" binfile="$(find roslaunch)/example.launch" />
<param name="binaryfile" binfile="$(find roslaunch)/resources/example.launch" />
<!-- upload the output of a command as a param. -->
<param name="commandoutput" command="cat &quot;$(find roslaunch)/example.launch&quot;" />
<param name="commandoutput" command="cat &quot;$(find roslaunch)/resources/example.launch&quot;" />


<!-- test that we can override params -->
Expand Down

0 comments on commit 964da45

Please sign in to comment.