Exemplo n.º 1
0
def build_fuzzers(config):
    """Builds all of the fuzzers for a specific OSS-Fuzz project.

  Args:
    project_name: The name of the OSS-Fuzz project being built.
    project_repo_name: The name of the project's repo.
    workspace: The location in a shared volume to store a git repo and build
      artifacts.
    pr_ref: The pull request reference to be built.
    commit_sha: The commit sha for the project to be built at.
    sanitizer: The sanitizer the fuzzers should be built with.

  Returns:
    True if build succeeded or False on failure.
  """
    # Do some quick validation.
    if config.project_src_path and not check_project_src_path(
            config.project_src_path):
        return False

    # Get the builder and then build the fuzzers.
    ci_system = continuous_integration.get_ci(config)
    logging.info('ci_system: %s.', ci_system)
    builder = Builder(config, ci_system)
    return builder.build()
Exemplo n.º 2
0
 def _create_builder(self, tmp_dir):
     """Creates an InternalGithubBuilder and returns it."""
     config = create_config(project_name=self.PROJECT_NAME,
                            project_repo_name=self.PROJECT_REPO_NAME,
                            workspace=tmp_dir,
                            sanitizer=self.SANITIZER,
                            commit_sha=self.COMMIT_SHA,
                            pr_ref=self.PR_REF,
                            is_github=True)
     ci_system = continuous_integration.get_ci(config)
     return build_fuzzers.Builder(config, ci_system)
Exemplo n.º 3
0
 def _create_builder(self, tmp_dir, oss_fuzz_project_name='myproject'):
     """Creates an InternalGithubBuilder and returns it."""
     config = test_helpers.create_build_config(
         oss_fuzz_project_name=oss_fuzz_project_name,
         project_repo_name=self.PROJECT_REPO_NAME,
         workspace=tmp_dir,
         sanitizer=self.SANITIZER,
         commit_sha=self.COMMIT_SHA,
         pr_ref=self.PR_REF,
         is_github=True)
     ci_system = continuous_integration.get_ci(config)
     builder = build_fuzzers.Builder(config, ci_system)
     builder.repo_manager = repo_manager.RepoManager('/fake')
     return builder
Exemplo n.º 4
0
def build_fuzzers(config):
    """Builds all of the fuzzers for a specific OSS-Fuzz project.

  Args:
    config: The configuration object for building fuzzers.

  Returns:
    True if build succeeded.
  """
    # Do some quick validation.
    if config.project_src_path and not check_project_src_path(
            config.project_src_path):
        return False

    # Get the builder and then build the fuzzers.
    ci_system = continuous_integration.get_ci(config)
    logging.info('ci_system: %s.', ci_system)
    builder = Builder(config, ci_system)
    return builder.build()
Exemplo n.º 5
0
 def __init__(self, config, workspace):
     self.config = config
     self.workspace = workspace
     self.ci_system = continuous_integration.get_ci(config)