Ejemplo n.º 1
0
    def run_cov_new_units(self):
        """Run the coverage binary on new units."""
        coverage_binary = coverage_utils.get_coverage_binary(self.benchmark)
        crashing_units = run_coverage.do_coverage_run(
            coverage_binary, self.corpus_dir, self.profraw_file_pattern,
            self.crashes_dir)

        self.UNIT_BLACKLIST[self.benchmark] = (
            self.UNIT_BLACKLIST[self.benchmark].union(set(crashing_units)))
Ejemplo n.º 2
0
    def test_integration_do_coverage_run_crash(self, tmp_path):
        """Test that do_coverage_run returns crashing inputs."""
        units = _get_test_data_dir('crash-corpus')
        coverage_dir = _make_coverage_dir(tmp_path)
        profraw_file = os.path.join(coverage_dir, 'test_crash.profraw')
        crashes_dir = _make_crashes_dir(tmp_path)
        crashing_units = run_coverage.do_coverage_run(
            self.COVERAGE_BINARY_PATH, units, profraw_file, crashes_dir)

        # Ensure the crashing units are returned.
        assert crashing_units == ['86f7e437faa5a7fce15d1ddcb9eaeaea377667b8']
        _assert_profraw_files(coverage_dir)
Ejemplo n.º 3
0
    def test_integration_do_coverage_run_max_total_timeout(
            self, mocked_log_error, tmp_path):
        """Test that do_coverage_run respects max total time."""
        units = _get_test_data_dir('timeout-corpus')
        coverage_dir = _make_coverage_dir(tmp_path)
        profraw_file = os.path.join(coverage_dir, 'test_max_time.profraw')
        crashes_dir = _make_crashes_dir(tmp_path)
        crashing_units = run_coverage.do_coverage_run(
            self.COVERAGE_BINARY_PATH, units, profraw_file, crashes_dir)

        assert mocked_log_error.call_count
        # Ensure no crashing unit is returned.
        assert not crashing_units
Ejemplo n.º 4
0
    def test_integration_do_coverage_run_no_crash(self, tmp_path):
        """Test that do_coverage_run doesn't return crashing inputs when there
        are none."""
        units = _get_test_data_dir('corpus')
        coverage_dir = _make_coverage_dir(tmp_path)
        profraw_file = os.path.join(coverage_dir, 'test_no_crash.profraw')
        crashes_dir = _make_crashes_dir(tmp_path)
        crashing_units = run_coverage.do_coverage_run(
            self.COVERAGE_BINARY_PATH, units, profraw_file, crashes_dir)

        # Ensure no crashing unit is returned.
        assert not crashing_units
        _assert_profraw_files(coverage_dir)