Ejemplo n.º 1
0
    def build_target(self):
        """Build the correct revision in the source directory."""
        if not self.options.disable_gclient:
            common.execute('gclient', 'sync', self.source_directory)

        self.pre_build_steps()
        self.setup_gn_args()
        goma_cores = self.get_goma_cores()

        common.execute('ninja',
                       "-w 'dupbuild=err' -C %s -j %i -l 15 %s" %
                       (self.build_directory, goma_cores, self.target),
                       self.source_directory,
                       capture_output=False,
                       stdout_transformer=output_transformer.Ninja())
    def test_print(self):
        """Test ninja output."""
        self.output = StringIO.StringIO()

        transformer = output_transformer.Ninja()
        transformer.set_output(self.output)
        transformer.process('aaaaa\n')
        transformer.process('bbb')
        transformer.process('\nccc')
        transformer.process('c\ndddddd')
        transformer.flush()

        self.assertEqual(
            'aaaaa\b\b\b\b\bbbb  \b\b\b\b\bcccc \b\b\b\b\bdddddd\n',
            self.output.getvalue())
        self.output.close()
  def build_target(self):
    """Build the correct revision in the source directory."""
    self.setup_gn_args()
    self.setup_all_deps()
    self.gn_gen()

    common.execute(
        'ninja',
        ("-w 'dupbuild=err' -C {build_dir} -j {goma_cores} -l {goma_load} "
         '{target}'.format(
             build_dir=self.build_directory,
             goma_cores=self.get_goma_cores(),
             goma_load=self.get_goma_load(),
             target=self.target)),
        self.source_directory,
        capture_output=False,
        stdout_transformer=output_transformer.Ninja())
Ejemplo n.º 4
0
    def build(self):
        """Build the correct revision in the source directory."""
        if not self.options.current:
            git_checkout(self.get_git_sha(), self.testcase.revision,
                         self.get_main_repo_path())

        self.setup_all_deps()
        self.gn_gen()

        common.execute(
            'ninja',
            ("-w 'dupbuild=err' -C {build_dir} -j {goma_cores} -l {goma_load} "
             '{targets}'.format(
                 build_dir=self.get_build_dir_path(),
                 goma_cores=compute_goma_cores(self.options.goma_threads,
                                               self.options.disable_goma),
                 goma_load=compute_goma_load(self.options.goma_load),
                 targets=' '.join(self.get_target_names()))),
            # Unset the memory tools' envs. See:
            # https://github.com/google/clusterfuzz-tools/issues/433
            self.get_source_dir_path(),
            capture_output=False,
            stdout_transformer=output_transformer.Ninja())