Esempio n. 1
0
 def test_generate_cmake_file(self):
     cmake_lines = (generate_cmake_file(package_name='pack1',
                                        version='0.0.1',
                                        scripts=[],
                                        package_dir={'': 'foopath'},
                                        pkgs=['foo', 'bar', 'bar.sub']))
     self.assertEqual([
         'set(pack1_SETUP_PY_VERSION "0.0.1")',
         'set(pack1_SETUP_PY_SCRIPTS "")',
         'set(pack1_SETUP_PY_PACKAGES "foo;bar")',
         'set(pack1_SETUP_PY_PACKAGE_DIRS "foopath/foo;foopath/bar")'
     ], cmake_lines)
     cmake_lines = (generate_cmake_file(package_name='pack1',
                                        version='0.0.1',
                                        scripts=[],
                                        package_dir={},
                                        pkgs=['foo', 'bar', 'bar.sub']))
     self.assertEqual([
         'set(pack1_SETUP_PY_VERSION "0.0.1")',
         'set(pack1_SETUP_PY_SCRIPTS "")',
         'set(pack1_SETUP_PY_PACKAGES "foo;bar")',
         'set(pack1_SETUP_PY_PACKAGE_DIRS "foo;bar")'
     ], cmake_lines)
     cmake_lines = (generate_cmake_file(package_name='pack1',
                                        version='0.0.1',
                                        scripts=['bin/foo', 'nodes/bar'],
                                        package_dir={},
                                        pkgs=['foo', 'bar', 'bar.sub']))
     self.assertEqual([
         'set(pack1_SETUP_PY_VERSION "0.0.1")',
         'set(pack1_SETUP_PY_SCRIPTS "bin/foo;nodes/bar")',
         'set(pack1_SETUP_PY_PACKAGES "foo;bar")',
         'set(pack1_SETUP_PY_PACKAGE_DIRS "foo;bar")'
     ], cmake_lines)
 def test_generate_cmake_file(self):
     cmake_lines = (generate_cmake_file(package_name='pack1',
                                        version='0.0.1',
                                        scripts=[],
                                        package_dir={'': 'foopath'},
                                        pkgs=['foo', 'bar', 'bar.sub']))
     self.assertEqual(['set(pack1_SETUP_PY_VERSION "0.0.1")',
                       'set(pack1_SETUP_PY_SCRIPTS "")',
                       'set(pack1_SETUP_PY_PACKAGES "foo;bar")',
                       'set(pack1_SETUP_PY_PACKAGE_DIRS "foopath/foo;foopath/bar")'],
                      cmake_lines)
     cmake_lines = (generate_cmake_file(package_name='pack1',
                                        version='0.0.1',
                                        scripts=[],
                                        package_dir={},
                                        pkgs=['foo', 'bar', 'bar.sub']))
     self.assertEqual(['set(pack1_SETUP_PY_VERSION "0.0.1")',
                       'set(pack1_SETUP_PY_SCRIPTS "")',
                       'set(pack1_SETUP_PY_PACKAGES "foo;bar")',
                       'set(pack1_SETUP_PY_PACKAGE_DIRS "foo;bar")'],
                      cmake_lines)
     cmake_lines = (generate_cmake_file(package_name='pack1',
                                        version='0.0.1',
                                        scripts=['bin/foo', 'nodes/bar'],
                                        package_dir={},
                                        pkgs=['foo', 'bar', 'bar.sub']))
     self.assertEqual(['set(pack1_SETUP_PY_VERSION "0.0.1")',
                       'set(pack1_SETUP_PY_SCRIPTS "bin/foo;nodes/bar")',
                       'set(pack1_SETUP_PY_PACKAGES "foo;bar")',
                       'set(pack1_SETUP_PY_PACKAGE_DIRS "foo;bar")'],
                      cmake_lines)
 def test_generate_cmake_file_noallprefix(self):
     cmake_lines = (generate_cmake_file(package_name='pack1',
                                        version='0.0.1',
                                        scripts=[],
                                        package_dir={'foo': 'src',
                                                     'bar': 'lib'},
                                        pkgs=['foo', 'bar', 'bar.sub']))
     self.assertEqual(['set(pack1_SETUP_PY_VERSION "0.0.1")',
                       'set(pack1_SETUP_PY_SCRIPTS "")',
                       'set(pack1_SETUP_PY_PACKAGES "foo;bar")',
                       'set(pack1_SETUP_PY_PACKAGE_DIRS "src/foo;lib/bar")'],
                      cmake_lines)
Esempio n. 4
0
 def test_generate_cmake_file_noallprefix(self):
     cmake_lines = (generate_cmake_file(package_name='pack1',
                                        version='0.0.1',
                                        scripts=[],
                                        package_dir={'foo': 'src',
                                                     'bar': 'lib'},
                                        pkgs=['foo', 'bar', 'bar.sub']))
     self.assertEqual(['set(pack1_SETUP_PY_VERSION "0.0.1")',
                       'set(pack1_SETUP_PY_SCRIPTS "")',
                       'set(pack1_SETUP_PY_PACKAGES "foo;bar")',
                       'set(pack1_SETUP_PY_PACKAGE_DIRS "src/foo;lib/bar")'],
                      cmake_lines)
 def test_generate_cmake_file_msg_srv(self):
     cmake_lines = (generate_cmake_file(package_name='pack1',
                                        version='0.0.1',
                                        scripts=[],
                                        package_dir={'foo.msg': 'msg',
                                                     'foo.srv': 'srv',
                                                     '': 'src'},
                                        pkgs=['foo.msg', 'foo.srv', 'foo']))
     self.assertEqual(['set(pack1_SETUP_PY_VERSION "0.0.1")',
                       'set(pack1_SETUP_PY_SCRIPTS "")',
                       'set(pack1_SETUP_PY_PACKAGES "foo")',
                       'set(pack1_SETUP_PY_PACKAGE_DIRS "src/foo")'],
                      cmake_lines)
Esempio n. 6
0
 def test_generate_cmake_file_msg_srv(self):
     cmake_lines = (generate_cmake_file(package_name='pack1',
                                        version='0.0.1',
                                        scripts=[],
                                        package_dir={'foo.msg': 'msg',
                                                     'foo.srv': 'srv',
                                                     '': 'src'},
                                        pkgs=['foo.msg', 'foo.srv', 'foo']))
     self.assertEqual(['set(pack1_SETUP_PY_VERSION "0.0.1")',
                       'set(pack1_SETUP_PY_SCRIPTS "")',
                       'set(pack1_SETUP_PY_PACKAGES "foo")',
                       'set(pack1_SETUP_PY_PACKAGE_DIRS "src/foo")'],
                      cmake_lines)