Show More
@@ -8,6 +8,7 syntax: glob | |||||
8 | *.pyc |
|
8 | *.pyc | |
9 | *.swp |
|
9 | *.swp | |
10 | *.prof |
|
10 | *.prof | |
|
11 | tests/.coverage* | |||
11 | tests/*.err |
|
12 | tests/*.err | |
12 | build |
|
13 | build | |
13 | dist |
|
14 | dist |
@@ -1,4 +1,9 | |||||
1 | #!/bin/sh -e |
|
1 | #!/bin/sh -e | |
|
2 | # | |||
|
3 | # environment variables: | |||
|
4 | # | |||
|
5 | # TEST_COVERAGE - set non-empty if you want to print test coverage report | |||
|
6 | # COVERAGE_STDLIB - set non-empty to report coverage of standard library | |||
2 |
|
7 | |||
3 | LANG="C"; export LANG |
|
8 | LANG="C"; export LANG | |
4 | LC_CTYPE="C"; export LC_CTYPE |
|
9 | LC_CTYPE="C"; export LC_CTYPE | |
@@ -64,7 +69,19 else | |||||
64 | fi |
|
69 | fi | |
65 | cd "$TESTDIR" |
|
70 | cd "$TESTDIR" | |
66 |
|
71 | |||
67 | BINDIR="$INST/bin" |
|
72 | BINDIR="$INST/bin"; export BINDIR | |
|
73 | if [ -n "$TEST_COVERAGE" ]; then | |||
|
74 | COVERAGE_FILE="$TESTDIR/.coverage"; export COVERAGE_FILE | |||
|
75 | rm -f "$COVERAGE_FILE" | |||
|
76 | mv "$BINDIR/hg" "$BINDIR/hg.py" | |||
|
77 | { | |||
|
78 | echo '#!/bin/sh' | |||
|
79 | echo "exec \"${PYTHON-python}\" \"$TESTDIR/coverage.py\"" \ | |||
|
80 | "-x \"$BINDIR/hg.py\" \"\$@\"" | |||
|
81 | } > "$BINDIR/hg" | |||
|
82 | chmod 700 "$BINDIR/hg" | |||
|
83 | fi | |||
|
84 | ||||
68 | PATH="$BINDIR:$PATH"; export PATH |
|
85 | PATH="$BINDIR:$PATH"; export PATH | |
69 | if [ -n "$PYTHON" ]; then |
|
86 | if [ -n "$PYTHON" ]; then | |
70 | { |
|
87 | { | |
@@ -153,6 +170,17 done | |||||
153 | echo |
|
170 | echo | |
154 | echo "Ran $tests tests, $failed failed." |
|
171 | echo "Ran $tests tests, $failed failed." | |
155 |
|
172 | |||
|
173 | if [ -n "$TEST_COVERAGE" ]; then | |||
|
174 | unset PYTHONPATH | |||
|
175 | $ECHO_N "$BINDIR,$TESTDIR,$HGTMP/test-," > "$HGTMP/omit" | |||
|
176 | if [ -z "$COVERAGE_STDLIB" ]; then | |||
|
177 | "${PYTHON-python}" -c 'import sys; print ",".join(sys.path)' \ | |||
|
178 | >> "$HGTMP/omit" | |||
|
179 | fi | |||
|
180 | cd "$PYTHONDIR" | |||
|
181 | "${PYTHON-python}" "$TESTDIR/coverage.py" -r --omit="`cat \"$HGTMP/omit\"`" | |||
|
182 | fi | |||
|
183 | ||||
156 | if [ $failed -gt 0 ] ; then |
|
184 | if [ $failed -gt 0 ] ; then | |
157 | exit 1 |
|
185 | exit 1 | |
158 | fi |
|
186 | fi |
General Comments 0
You need to be logged in to leave comments.
Login now