]> git.proxmox.com Git - ceph.git/blame - ceph/src/jaegertracing/jaeger-client-cpp/scripts/upload-coverage.sh
buildsys: switch source download to quincy
[ceph.git] / ceph / src / jaegertracing / jaeger-client-cpp / scripts / upload-coverage.sh
CommitLineData
f67539c2
TL
1#!/bin/bash
2
3# Copyright (c) 2018 Uber Technologies, Inc.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17set -e
18
19function main() {
20 set -x
21 if ! [[ "${CMAKE_OPTIONS}" =~ "-DJAEGERTRACING_COVERAGE=ON" ]]; then
22 exit 0
23 fi
24 unset -x
25
26 local project_dir
27 project_dir=$(git rev-parse --show-toplevel)
28 cd "$project_dir" || exit 1
29
30 local gcov_tool
31 case "$CC" in
32 gcc*) gcov_tool=${CC/gcc/gcov}
33 ;;
34 *) gcov_tool="$project_dir/scripts/llvm-gcov.sh"
35 ;;
36 esac
37 find build -name '*.gcno' -exec "$gcov_tool" {} \;
38 bash <(curl -s https://codecov.io/bash) || \
39 echo "Codecov did not collect coverage reports"
40}
41
42main