Пример #1
0
    def validate_fuzzer(self, path: Path):
        """Return True if |path| is part of a valid fuzzer. Otherwise return
        False and print an error."""
        fuzzer = get_fuzzer(path)

        if fuzzer is None:
            return True

        if fuzzer in self.invalid_fuzzers:
            # We know this is invalid and have already complained about it.
            return False

        valid = fuzzer_utils.validate(fuzzer)
        if valid:
            return True

        self.invalid_fuzzers.add(fuzzer)

        print(fuzzer, 'is not valid.')
        return False
Пример #2
0
def validate_fuzzer(fuzzer: str):
    """Parses and validates a fuzzer name."""
    if not fuzzer_utils.validate(fuzzer):
        raise ValidationError('Fuzzer: %s is invalid.' % fuzzer)