diff options
author | Max Moroz <mmoroz@chromium.org> | 2020-08-12 09:32:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-12 09:32:05 -0700 |
commit | e4d3fb0f8ca159295bbacfdaee2b7c32489b5c6c (patch) | |
tree | 2f44bccb710e06f27ac9822f43bad6ead5367c5c /infra/helper.py | |
parent | 934898182204fced2cf9c7235770e9c592be7940 (diff) | |
download | oss-fuzz-e4d3fb0f8ca159295bbacfdaee2b7c32489b5c6c.tar.gz |
[infra][docs] Be more explicit about code coverage being supported for C/C++ only (#4284). (#4303)
* [infra][docs] Be more explicit about code coverage being supported for C/C++ only (#4284).
* fix typos and pass env variable
Diffstat (limited to 'infra/helper.py')
-rwxr-xr-x | infra/helper.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/infra/helper.py b/infra/helper.py index b1266c287..99d871129 100755 --- a/infra/helper.py +++ b/infra/helper.py @@ -58,6 +58,9 @@ CORPUS_BACKUP_URL_FORMAT = ( PROJECT_LANGUAGE_REGEX = re.compile(r'\s*language\s*:\s*([^\s]+)') +# Languages from project.yaml that have code coverage support. +LANGUAGES_WITH_COVERAGE_SUPPORT = ['c', 'c++'] + def main(): # pylint: disable=too-many-branches,too-many-return-statements,too-many-statements """Get subcommand from program arguments and do it.""" @@ -727,12 +730,21 @@ def coverage(args): if not check_project_exists(args.project_name): return 1 + project_language = _get_project_language(args.project_name) + if project_language not in LANGUAGES_WITH_COVERAGE_SUPPORT: + print( + 'ERROR: Project is written in %s, coverage for it is not supported yet.' + % project_language, + file=sys.stderr) + return 1 + if not args.no_corpus_download and not args.corpus_dir: if not download_corpora(args): return 1 env = [ 'FUZZING_ENGINE=libfuzzer', + 'FUZZING_LANGUAGE=%s' % project_language, 'PROJECT=%s' % args.project_name, 'SANITIZER=coverage', 'HTTP_PORT=%s' % args.port, |