mirror of https://github.com/google/oss-fuzz.git
Add a --no-serve option to the helper coverage command. (#10628)
This turns off the http report serving after a successful generation.
This commit is contained in:
parent
9fca6817ed
commit
aca1497abf
|
@ -518,12 +518,16 @@ else
|
||||||
|
|
||||||
generate_html $profdata_path "$shared_libraries" "$fuzz_target" "$report_dir"
|
generate_html $profdata_path "$shared_libraries" "$fuzz_target" "$report_dir"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
set +e
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure report is readable.
|
# Make sure report is readable.
|
||||||
chmod -R +r $REPORT_ROOT_DIR $REPORT_BY_TARGET_ROOT_DIR
|
chmod -R +r $REPORT_ROOT_DIR $REPORT_BY_TARGET_ROOT_DIR
|
||||||
find $REPORT_ROOT_DIR $REPORT_BY_TARGET_ROOT_DIR -type d -exec chmod +x {} +
|
find $REPORT_ROOT_DIR $REPORT_BY_TARGET_ROOT_DIR -type d -exec chmod +x {} +
|
||||||
|
|
||||||
|
# HTTP_PORT is optional.
|
||||||
|
set +u
|
||||||
if [[ -n $HTTP_PORT ]]; then
|
if [[ -n $HTTP_PORT ]]; then
|
||||||
# Serve the report locally.
|
# Serve the report locally.
|
||||||
echo "Serving the report on http://127.0.0.1:$HTTP_PORT/linux/index.html"
|
echo "Serving the report on http://127.0.0.1:$HTTP_PORT/linux/index.html"
|
||||||
|
|
|
@ -372,6 +372,9 @@ def get_parser(): # pylint: disable=too-many-statements,too-many-locals
|
||||||
help='do not download corpus backup from '
|
help='do not download corpus backup from '
|
||||||
'OSS-Fuzz; use corpus located in '
|
'OSS-Fuzz; use corpus located in '
|
||||||
'build/corpus/<project>/<fuzz_target>/')
|
'build/corpus/<project>/<fuzz_target>/')
|
||||||
|
coverage_parser.add_argument('--no-serve',
|
||||||
|
action='store_true',
|
||||||
|
help='do not serve a local HTTP server.')
|
||||||
coverage_parser.add_argument('--port',
|
coverage_parser.add_argument('--port',
|
||||||
default='8008',
|
default='8008',
|
||||||
help='specify port for'
|
help='specify port for'
|
||||||
|
@ -1207,11 +1210,13 @@ def coverage(args):
|
||||||
'FUZZING_LANGUAGE=%s' % args.project.language,
|
'FUZZING_LANGUAGE=%s' % args.project.language,
|
||||||
'PROJECT=%s' % args.project.name,
|
'PROJECT=%s' % args.project.name,
|
||||||
'SANITIZER=coverage',
|
'SANITIZER=coverage',
|
||||||
'HTTP_PORT=%s' % args.port,
|
|
||||||
'COVERAGE_EXTRA_ARGS=%s' % ' '.join(args.extra_args),
|
'COVERAGE_EXTRA_ARGS=%s' % ' '.join(args.extra_args),
|
||||||
'ARCHITECTURE=' + args.architecture,
|
'ARCHITECTURE=' + args.architecture,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if not args.no_serve:
|
||||||
|
env.append(f'HTTP_PORT={args.port}')
|
||||||
|
|
||||||
run_args = _env_to_docker_args(env)
|
run_args = _env_to_docker_args(env)
|
||||||
|
|
||||||
if args.port:
|
if args.port:
|
||||||
|
|
Loading…
Reference in New Issue