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

Side by Side Diff: third_party/lit/utils/check-coverage

Issue 1663053003: [fusl] Add llvm's lit tool to third_party (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: move down a dir Created 4 years, 10 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 | « third_party/lit/utils/README.txt ('k') | third_party/lit/utils/check-sdist » ('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
3 prog=$(basename $0)
4
5 # Expect to be run from the parent lit directory.
6 if [ ! -f setup.py ] || [ ! -d lit ]; then
7 printf 1>&2 "%s: expected to be run from base lit directory\n" "$prog"
8 exit 1
9 fi
10
11 # Parse command line arguments.
12 if [ "$1" = "--generate-html" ]; then
13 GENERATE_HTML=1
14 shift
15 fi
16
17 # If invoked with no arguments, run all the tests.
18 if [ $# = "0" ]; then
19 set -- "tests"
20 fi
21
22 # Check that the active python has been modified to enable coverage in its
23 # sitecustomize.
24 if ! python -c \
25 'import sitecustomize, sys; sys.exit("coverage" not in dir(sitecustomize)) ' \
26 >/dev/null 2>&1; then
27 printf 1>&2 "error: active python does not appear to enable coverage in its 'sitecustomize.py'\n"
28 exit 1
29 fi
30
31 # First, remove any existing coverage data files.
32 rm -f tests/.coverage
33 find tests -name .coverage.\* -exec rm {} \;
34
35 # Next, run the tests.
36 lit -sv --param check-coverage=1 "$@"
37
38 # Next, move all the data files from subdirectories up.
39 find tests/* -name .coverage.\* -exec mv {} tests \;
40
41 # Combine all the data files.
42 (cd tests && python -m coverage combine)
43
44 # Finally, generate the report.
45 (cd tests && python -m coverage report)
46
47 # Generate the HTML report, if requested.
48 if [ ! -z "$GENERATE_HTML" ]; then
49 (cd tests && python -m coverage html)
50 fi
OLDNEW
« no previous file with comments | « third_party/lit/utils/README.txt ('k') | third_party/lit/utils/check-sdist » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698