Revision 141c8421

b/Makefile.am
1640 1640

  
1641 1641
.PHONY: py-coverage
1642 1642
py-coverage: $(GENERATED_FILES) $(python_tests)
1643
	@test -n "$(PYCOVERAGE)" || \
1644
	    { echo 'python-coverage' not found during configure; exit 1; }
1643 1645
	set -e; \
1646
	COVERAGE=$(PYCOVERAGE) \
1644 1647
	COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
1645 1648
	TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
1646 1649
	HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
b/autotools/gen-coverage
21 21
set -e
22 22
set -u
23 23

  
24
: ${COVERAGE:=coverage}
25 24
: ${PYTHON:=python}
25
: ${COVERAGE:?}
26 26
: ${COVERAGE_FILE:?}
27 27
: ${TEXT_COVERAGE:?}
28
: ${HTML_COVERAGE:=}
28 29
: ${GANETI_TEMP_DIR:?}
29 30

  
30 31
reportargs=(
......
34 35

  
35 36
$COVERAGE erase
36 37

  
38
if [[ -n "$HTML_COVERAGE" ]]; then
39
  if [[ ! -d "$HTML_COVERAGE" ]]; then
40
    echo "Not a directory: $HTML_COVERAGE" >&2
41
    exit 1
42
  fi
43

  
44
  # At least coverage 3.4 fails to overwrite files
45
  find "$HTML_COVERAGE" \( -type f -o -type l \) -delete
46
fi
47

  
37 48
for script; do
38 49
  if [[ "$script" == *-runasroot.py ]]; then
39 50
    if [[ -z "$FAKEROOT" ]]; then
b/configure.ac
373 373
then
374 374
  AC_MSG_WARN([pep8 not found, checking code will not be complete])
375 375
fi
376
AM_CONDITIONAL([HAS_PEP8], [test "$PEP8"])
376
AM_CONDITIONAL([HAS_PEP8], [test -n "$PEP8"])
377

  
378
# Check for python-coverage
379
AC_ARG_VAR(PYCOVERAGE, [python-coverage path])
380
AC_PATH_PROGS(PYCOVERAGE, [python-coverage coverage], [])
381
if test -z "$PYCOVERAGE"
382
then
383
  AC_MSG_WARN(m4_normalize([python-coverage or coverage not found, evaluating
384
                            Python test coverage will not be possible]))
385
fi
377 386

  
378 387
# Check for socat
379 388
AC_ARG_VAR(SOCAT, [socat path])

Also available in: Unified diff