Ejemplo n.º 1
0
def main(argv):
    opts = _ParseArgs(argv)
    try:
        sysroot.SetupBoard(opts.build_target, opts.accept_licenses,
                           opts.run_config)
    except portage_util.MissingOverlayError as e:
        # Add a bit more user friendly message as people can typo names easily.
        cros_build_lib.Die(
            '%s\n'
            "Double check the --board setting and make sure you're syncing the "
            'right manifest (internal-vs-external).', e)
    except sysroot.Error as e:
        cros_build_lib.Die(e)
Ejemplo n.º 2
0
  def testFullRun(self):
    """Test a regular full run.

    This method is basically just a sanity check that it's trying to create the
    sysroot and install the toolchain by default.
    """
    target_sysroot = sysroot_lib.Sysroot('/build/board')
    create_mock = self.PatchObject(sysroot, 'Create',
                                   return_value=target_sysroot)
    install_toolchain_mock = self.PatchObject(sysroot, 'InstallToolchain')

    sysroot.SetupBoard(build_target_util.BuildTarget('board'))

    create_mock.assert_called_once()
    install_toolchain_mock.assert_called_once()
Ejemplo n.º 3
0
  def testRegenConfigs(self):
    """Test the regen configs install prevention."""
    target_sysroot = sysroot_lib.Sysroot('/build/board')
    create_mock = self.PatchObject(sysroot, 'Create',
                                   return_value=target_sysroot)
    install_toolchain_mock = self.PatchObject(sysroot, 'InstallToolchain')

    target = build_target_util.BuildTarget('board')
    configs = sysroot.SetupBoardRunConfig(regen_configs=True)

    sysroot.SetupBoard(target, run_configs=configs)

    # Should still try to create the sysroot, but should not try to install
    # the toolchain.
    create_mock.assert_called_once()
    install_toolchain_mock.assert_not_called()