[infra] Add an option to disable serving coverage report over HTTP (needed for #1547). (#1635)

This commit is contained in:
Max Moroz 2018-07-20 15:43:08 -07:00 committed by GitHub
parent 645a0375fe
commit 218f5dc3cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -41,7 +41,7 @@ function run_fuzz_target {
local args="-timeout=100 -runs=0 /corpus/${target}"
LLVM_PROFILE_FILE="$target.profraw" $target $args &> $LOGS_DIR/$target.log
if (( $? != 0)); then
if (( $? != 0 )); then
echo "Error occured while running $target:"
cat $LOGS_DIR/$target.log
fi
@ -81,7 +81,9 @@ rm *.profraw
llvm-cov show -format=html -output-dir=$REPORT_DIR -path-equivalence="/,$OUT" \
$COVERAGE_EXTRA_ARGS -instr-profile merged.profdata $objects
# Serve the report locally.
echo "Serving the report on http://127.0.0.1:$HTTP_PORT/"
cd $REPORT_DIR
python3 -m http.server $HTTP_PORT
if [[ -n $HTTP_PORT ]]; then
# Serve the report locally.
echo "Serving the report on http://127.0.0.1:$HTTP_PORT/"
cd $REPORT_DIR
python3 -m http.server $HTTP_PORT
fi