Exemplo n.º 1
0
    def test_handle_cmake_args(self):
        args = ['-DCMAKE_INSTALL_PREFIX=install', '--install']
        cmake_args, args = extract_cmake_args(args)
        assert cmake_args == ['-DCMAKE_INSTALL_PREFIX=install'], cmake_args
        opts = parse_args(args)
        cmake_args, opts = handle_cmake_args(cmake_args, opts)
        assert cmake_args == [], cmake_args
        assert opts.install == True
        assert opts.install_space == 'install'

        args = [
            '-DCMAKE_INSTALL_PREFIX=install', '--install', '--install-space',
            'install_isolated'
        ]
        cmake_args, args = extract_cmake_args(args)
        assert cmake_args == ['-DCMAKE_INSTALL_PREFIX=install'], cmake_args
        opts = parse_args(args)
        cmake_args, opts = handle_cmake_args(cmake_args, opts)
        assert cmake_args == [], cmake_args
        assert opts.install == True
        assert opts.install_space == 'install_isolated'

        args = ['-DCATKIN_DEVEL_PREFIX=devel']
        cmake_args, args = extract_cmake_args(args)
        assert cmake_args == ['-DCATKIN_DEVEL_PREFIX=devel'], cmake_args
        opts = parse_args(args)
        cmake_args, opts = handle_cmake_args(cmake_args, opts)
        assert cmake_args == [], cmake_args
        assert opts.devel == 'devel'

        args = [
            '-DCATKIN_DEVEL_PREFIX=devel', '--devel-space', 'devel_isolated'
        ]
        cmake_args, args = extract_cmake_args(args)
        assert cmake_args == ['-DCATKIN_DEVEL_PREFIX=devel'], cmake_args
        opts = parse_args(args)
        cmake_args, opts = handle_cmake_args(cmake_args, opts)
        assert cmake_args == [], cmake_args
        assert opts.devel == 'devel_isolated'
Exemplo n.º 2
0
    def test_extract_cmake_args(self):
        args = []
        cmake_args, args = extract_cmake_args(args)
        assert cmake_args == []
        assert args == []

        args = ['-DCMAKE_INSTALL_PREFIX=install']
        cmake_args, args = extract_cmake_args(args)
        assert cmake_args == ['-DCMAKE_INSTALL_PREFIX=install']
        assert args == []

        args = ['-DCMAKE_INSTALL_PREFIX=install', '--install']
        cmake_args, args = extract_cmake_args(args)
        assert cmake_args == ['-DCMAKE_INSTALL_PREFIX=install']
        assert args == ['--install']

        args = [
            '-DCMAKE_INSTALL_PREFIX=install', '--install', '--install-space',
            'install_isolated'
        ]
        cmake_args, args = extract_cmake_args(args)
        assert cmake_args == ['-DCMAKE_INSTALL_PREFIX=install']
        assert args == ['--install', '--install-space', 'install_isolated']

        args = ['-DCATKIN_DEVEL_PREFIX=devel']
        cmake_args, args = extract_cmake_args(args)
        assert cmake_args == ['-DCATKIN_DEVEL_PREFIX=devel']
        assert args == []

        args = ['-DCATKIN_DEVEL_PREFIX=devel']
        cmake_args, args = extract_cmake_args(args)
        assert cmake_args == ['-DCATKIN_DEVEL_PREFIX=devel']
        assert args == []

        args = [
            '-DCATKIN_DEVEL_PREFIX=devel', '--devel-space', 'devel_isolated'
        ]
        cmake_args, args = extract_cmake_args(args)
        assert cmake_args == ['-DCATKIN_DEVEL_PREFIX=devel']
        assert args == ['--devel-space', 'devel_isolated']