Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1212)

Side by Side Diff: bin/coverage

Issue 2343243002: tools/coverage: clean up (Closed)
Patch Set: rm old version Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/coverage.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/sh
2 # Copyright 2016 Google Inc.
3 #
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 # Run something like this:
8 # $ bin/coverage dm --src tests
9 # or
10 # $ bin/coverage dm --src gm skp
11
12 set -x
13 set -e
14
15 cd "$(dirname "$0")/.."
16
17 EXECUTABLE="$1"
18 shift
19 GCOV="$(realpath tools/gcov_shim)"
mtklein 2016/09/20 22:38:53 When you read this code as it's grouped here, do y
hal.canary 2016/09/26 17:06:22 Done.
20
21 QUIET=-q
mtklein 2016/09/20 22:38:53 Why don't we fold this through now?
hal.canary 2016/09/26 17:06:22 Done.
22
23 DIR="$(mktemp -d "${TMPDIR:-/tmp}/skia_coverage_XXXXXXXXXX")"
24 BUILD=out/coverage
25
26 # Build $EXECUTABLE
27 bin/sync
28 bin/fetch-gn
29
30 #TODO: make this work with Clang.
31 CC="gcc"
32 CXX="g++"
33 FLAGS="--coverage"
34 gn gen --args="cc=\"${CC} ${FLAGS}\" cxx=\"${CXX} ${FLAGS}\"" "$BUILD"
mtklein 2016/09/20 22:38:53 Might be clearer if you set cc, cxx, extra_cflags,
hal.canary 2016/09/26 17:06:22 Done.
35
36 ninja -C "$BUILD" "$EXECUTABLE"
37
38 # Generate a zero-baseline so files not covered by $EXECUTABLE $@ will
39 # still show up in the report. This reads the .gcno files that are
40 # created at compile time.
41 lcov $QUIET --gcov-tool="$GCOV" -c -b "$BUILD" -d "$BUILD" -o "$DIR"/baseline -i
42
43 # Running the binary generates the real coverage information, the .gcda files.
44 "$BUILD"/"$EXECUTABLE" "$@"
45
46 lcov $QUIET --gcov-tool="$GCOV" -c -b "$BUILD" -d "$BUILD" -o "$DIR"/coverage
47
48 lcov $QUIET -a "$DIR"/baseline -a "$DIR"/coverage -o "$DIR"/merged
49
50 genhtml $QUIET "$DIR"/merged --legend -o "$DIR"/coverage_report --ignore-errors source
51
52 xdg-open "$DIR"/coverage_report/index.html
53
mtklein 2016/09/20 22:38:53 Might wanna kill off a blank line or two at the en
hal.canary 2016/09/26 17:06:22 Done.
54
OLDNEW
« no previous file with comments | « no previous file | tools/coverage.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698