Ejemplo n.º 1
0
    def test_common_msgs_against_installed(self):
        # uses core ros stacks installed in setUp
        # tries to build common_msgs in separate workspace
        try:
            # create another workspace than self.rootdir
            other_root_dir = tempfile.mkdtemp()
            other_src_dir = os.path.join(other_root_dir, 'src')
            create_catkin_workspace(other_src_dir)
            other_build_dir = os.path.join(other_root_dir, 'build')
            other_buildspace_dir = os.path.join(other_build_dir, 'buildspace')
            shutil.copytree(os.path.join(self.workspacedir, 'common_msgs'),
                            os.path.join(other_src_dir, 'common_msgs'))
            out = self.cmake(cwd=other_build_dir,
                             srcdir=other_src_dir)
            out = succeed(MAKE_CMD, cwd=other_build_dir)
            assert_exists(other_buildspace_dir,
                          PYTHON_INSTALL_PATH + '/nav_msgs/msg/_GridCells.py',
                          'include/nav_msgs/GridCells.h')

            out = succeed(MAKE_CMD + ['install'], cwd=other_build_dir)

            assert_exists(self.installdir,
                          'include/geometry_msgs/PointStamped.h',
                          PYTHON_INSTALL_PATH + '/geometry_msgs/msg/_PointStamped.py',
                          'share/geometry_msgs/msg/PointStamped.msg',
                          # 'share/typelibxml/geometry_msgs/PointStamped.xml',
                          )
        finally:
            # pass
            shutil.rmtree(other_root_dir)
Ejemplo n.º 2
0
    def test_common_msgs_against_installed(self):
        # uses core ros stacks installed in setUp
        # tries to build common_msgs in separate workspace
        try:
            # create another workspace than self.rootdir
            other_root_dir = tempfile.mkdtemp()
            other_src_dir = os.path.join(other_root_dir, 'src')
            create_catkin_workspace(other_src_dir)
            other_build_dir = os.path.join(other_root_dir, 'build')
            other_develspace_dir = os.path.join(other_build_dir, 'devel')
            shutil.copytree(os.path.join(self.workspacedir, 'common_msgs'),
                            os.path.join(other_src_dir, 'common_msgs'))
            out = self.cmake(cwd=other_build_dir,
                             srcdir=other_src_dir)
            out = succeed(MAKE_CMD, cwd=other_build_dir)
            assert_exists(other_develspace_dir,
                          PYTHON_INSTALL_PATH + '/nav_msgs/msg/_GridCells.py',
                          'include/nav_msgs/GridCells.h')

            out = succeed(MAKE_CMD + ['install'], cwd=other_build_dir)

            assert_exists(self.installdir,
                          'include/geometry_msgs/PointStamped.h',
                          PYTHON_INSTALL_PATH + '/geometry_msgs/msg/_PointStamped.py',
                          'share/geometry_msgs/msg/PointStamped.msg',
                          # 'share/typelibxml/geometry_msgs/PointStamped.xml',
                          )
        finally:
            # pass
            shutil.rmtree(other_root_dir)
    def test_catkin_only(self):
        self.cmake()
        succeed(MAKE_CMD, cwd=self.builddir)
        succeed(MAKE_CMD + ["install"], cwd=self.builddir)

        assert_exists(self.installdir,
                      "env.sh",
                      "setup.sh",
                      "setup.zsh")
Ejemplo n.º 4
0
    def test_catkin_only(self):
        self.cmake()
        succeed(MAKE_CMD, cwd=self.builddir)
        succeed(MAKE_CMD + ["install"], cwd=self.builddir)

        assert_exists(self.installdir,
                      "env.sh",
                      "setup.sh",
                      "setup.zsh")
Ejemplo n.º 5
0
    def test_catkin_only(self):
        self.cmake()
        succeed(MAKE_CMD, cwd=self.builddir)
        succeed(MAKE_CMD + ['install'], cwd=self.builddir)

        assert_exists(self.installdir,
                      'env.sh',
                      'setup.sh',
                      'setup.zsh')
    def test_linker_options_propagation(self):
        dstdir = os.path.join(self.workspacedir, 'linker_options')
        shutil.copytree(os.path.join(MOCK_DIR, 'src', 'linker_options'),
                        dstdir)
        self.cmake()
        succeed(MAKE_CMD, cwd=self.builddir)
        succeed(MAKE_CMD + ['install'], cwd=self.builddir)

        assert_exists(self.installdir, 'env.sh', 'setup.sh', 'setup.zsh')
Ejemplo n.º 7
0
    def test_mock_against_installed(self):
        # uses core ros stacks installed in setUp
        # tries to build mock project in separate workspace
        try:
            # create another workspace than self.rootdir
            other_root_dir = tempfile.mkdtemp()
            other_src_dir = os.path.join(other_root_dir, 'src')
            create_catkin_workspace(other_src_dir)
            other_build_dir = os.path.join(other_root_dir, 'build')
            other_develspace_dir = os.path.join(other_build_dir, 'devel')
            other_install_dir = os.path.join(other_root_dir, 'install')
            shutil.copytree(os.path.join(MOCK_DIR, 'src', 'catkin_test'),
                            os.path.join(other_src_dir, 'catkin_test'))
            self.cmake(cwd=other_build_dir,
                       srcdir=other_src_dir,
                       installdir=other_install_dir)
            succeed(MAKE_CMD, cwd=other_build_dir)

            assert_exists(other_develspace_dir,
                          "lib/liba.so",
                          "lib/libb.so",
                          "lib/libc-one.so",
                          "lib/libc-two.so",
                          "lib/libd.so")
            assert_exists(other_build_dir,
                          # "bin/nolangs_exec",
                          "catkin_test/quux_user/bin/quux_srv-exec")
            assert_exists(other_develspace_dir,
                          PYTHON_INSTALL_PATH + "/a",
                          # PYTHON_INSTALL_PATH + "/b",
                          # PYTHON_INSTALL_PATH + "/c",
                          # PYTHON_INSTALL_PATH + "/d",
                          PYTHON_INSTALL_PATH + "/a/__init__.py",
                          PYTHON_INSTALL_PATH + "/quux_msgs/__init__.py")

            # "DESTDIR="
            succeed(MAKE_CMD + ["install"],
                    cwd=other_build_dir)

            assert_exists(other_install_dir,
                          "lib/pkgconfig/a.pc",
                          "lib/pkgconfig/b.pc",
                          "lib/pkgconfig/c.pc",
                          "lib/pkgconfig/d.pc",
                          "lib/pkgconfig/quux_msgs.pc",
                          PYTHON_INSTALL_PATH + "/a/__init__.py",
                          PYTHON_INSTALL_PATH + "/quux_msgs/__init__.py")

            #
            #  make sure python imports work
            #

            # succeed([other_build_dir + "/env.sh", "python -c 'import a'"])
            # succeed([other_build_dir + "/env.sh", "python -c 'import b'"])
        finally:
            # pass
            shutil.rmtree(other_root_dir)
Ejemplo n.º 8
0
    def test_mock_against_installed(self):
        # uses core ros stacks installed in setUp
        # tries to build mock project in separate workspace
        try:
            # create another workspace than self.rootdir
            other_root_dir = tempfile.mkdtemp()
            other_src_dir = os.path.join(other_root_dir, 'src')
            create_catkin_workspace(other_src_dir)
            other_build_dir = os.path.join(other_root_dir, 'build')
            other_buildspace_dir = os.path.join(other_build_dir, 'buildspace')
            other_install_dir = os.path.join(other_root_dir, 'install')
            shutil.copytree(os.path.join(MOCK_DIR, 'src', 'catkin_test'),
                            os.path.join(other_src_dir, 'catkin_test'))
            self.cmake(cwd=other_build_dir,
                       srcdir=other_src_dir,
                       installdir=other_install_dir)
            succeed(MAKE_CMD, cwd=other_build_dir)

            assert_exists(other_buildspace_dir,
                          "lib/liba.so",
                          "lib/libb.so",
                          "lib/libc-one.so",
                          "lib/libc-two.so",
                          "lib/libd.so")
            assert_exists(other_build_dir,
                          # "bin/nolangs_exec",
                          "catkin_test/quux_user/bin/quux_srv-exec")
            assert_exists(other_buildspace_dir,
                          PYTHON_INSTALL_PATH + "/a",
                          # PYTHON_INSTALL_PATH + "/b",
                          # PYTHON_INSTALL_PATH + "/c",
                          # PYTHON_INSTALL_PATH + "/d",
                          PYTHON_INSTALL_PATH + "/a/__init__.py",
                          PYTHON_INSTALL_PATH + "/quux_msgs/__init__.py")

            # "DESTDIR="
            succeed(MAKE_CMD + ["install"],
                    cwd=other_build_dir)

            assert_exists(other_install_dir,
                          "lib/pkgconfig/a.pc",
                          "lib/pkgconfig/b.pc",
                          "lib/pkgconfig/c.pc",
                          "lib/pkgconfig/d.pc",
                          "lib/pkgconfig/quux_msgs.pc",
                          PYTHON_INSTALL_PATH + "/a/__init__.py",
                          PYTHON_INSTALL_PATH + "/quux_msgs/__init__.py")

            #
            #  make sure python imports work
            #

            # succeed([other_build_dir + "/env.sh", "python -c 'import a'"])
            # succeed([other_build_dir + "/env.sh", "python -c 'import b'"])
        finally:
            # pass
            shutil.rmtree(other_root_dir)
    def test_nolang(self):
        dstdir = os.path.join(self.workspacedir, 'nolangs')
        shutil.copytree(os.path.join(MOCK_DIR, 'src', 'nolangs'), dstdir)

        out = self.cmake(CATKIN_WHITELIST_PACKAGES='nolangs',
                         CATKIN_DPKG_BUILDPACKAGE_FLAGS='-d;-S;-us;-uc')
        self.assertTrue(os.path.exists(self.builddir + "/nolangs"))
        self.assertFalse(os.path.exists(self.builddir + "/std_msgs"))
        self.assertFalse(os.path.exists(self.builddir + "/genmsg"))
        out = succeed(MAKE_CMD, cwd=self.builddir)
        self.assertTrue(
            os.path.exists(self.builddir + "/nolangs/bin/nolangs_exec"))
        out = succeed(MAKE_CMD + ["install"], cwd=self.builddir)

        assert_exists(self.installdir, "bin/nolangs_exec",
                      "share/nolangs/cmake/nolangsConfig.cmake")

        # also test make help
        succeed(MAKE_CMD + ["help"], cwd=self.builddir)
    def test_nolang(self):
        dstdir = os.path.join(self.workspacedir, 'nolangs')
        shutil.copytree(os.path.join(MOCK_DIR, 'src', 'nolangs'), dstdir)

        out = self.cmake(CATKIN_WHITELIST_STACKS='nolangs',
                         CATKIN_DPKG_BUILDPACKAGE_FLAGS='-d;-S;-us;-uc')
        self.assertTrue(os.path.exists(self.builddir + "/nolangs"))
        self.assertFalse(os.path.exists(self.builddir + "/std_msgs"))
        self.assertFalse(os.path.exists(self.builddir + "/genmsg"))
        out = succeed(MAKE_CMD, cwd=self.builddir)
        self.assertTrue(os.path.exists(self.builddir + "/nolangs/bin/nolangs_exec"))
        out = succeed(MAKE_CMD + ["install"], cwd=self.builddir)

        assert_exists(self.installdir,
                      "bin/nolangs_exec",
                      "share/nolangs/cmake/nolangsConfig.cmake")

        # also test make help
        succeed(MAKE_CMD + ["help"], cwd=self.builddir)
Ejemplo n.º 11
0
    def test_make(self):
        # uses core ros stacks installed in setUp
        # just checks the result for success
        self.assertTrue(os.path.exists(self.workspacedir))

        assert_exists(self.builddir, 'ros')
        assert_exists(self.buildspace, 'bin', 'etc', 'include', 'lib', 'share')

        assert_exists(self.installdir, 'bin', 'etc', 'include', 'lib', 'share')
Ejemplo n.º 12
0
    def test_make(self):
        # uses core ros stacks installed in setUp
        # just checks the result for success
        self.assertTrue(os.path.exists(self.workspacedir))

        assert_exists(self.builddir,
                      'ros')
        assert_exists(self.develspace,
                      'bin',
                      'etc',
                      'include',
                      'lib',
                      'share')

        assert_exists(self.installdir,
                      'bin',
                      'etc',
                      'include',
                      'lib',
                      'share')