summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/test-installed-numpy.py4
-rwxr-xr-xtools/travis-test.sh15
2 files changed, 17 insertions, 2 deletions
diff --git a/tools/test-installed-numpy.py b/tools/test-installed-numpy.py
index 04a2a1da2..14f11b7ed 100644
--- a/tools/test-installed-numpy.py
+++ b/tools/test-installed-numpy.py
@@ -46,6 +46,10 @@ elif numpy.ones((10, 1), order='C').flags.f_contiguous:
print('NPY_RELAXED_STRIDES_CHECKING not set, but active.')
sys.exit(1)
+if options.coverage:
+ # Produce code coverage XML report for codecov.io
+ args += ["--cov-report=xml"]
+
result = numpy.test(options.mode,
verbose=options.verbose,
extra_argv=args,
diff --git a/tools/travis-test.sh b/tools/travis-test.sh
index b99866f0d..11863b5fe 100755
--- a/tools/travis-test.sh
+++ b/tools/travis-test.sh
@@ -105,6 +105,11 @@ run_test()
export PYTHONPATH=$PWD
fi
+ if [ -n "$RUN_COVERAGE" ]; then
+ pip install pytest-cov
+ COVERAGE_FLAG=--coverage
+ fi
+
# We change directories to make sure that python won't find the copy
# of numpy in the source directory.
mkdir -p empty
@@ -113,10 +118,17 @@ run_test()
"import os; import numpy; print(os.path.dirname(numpy.__file__))")
export PYTHONWARNINGS=default
if [ -n "$RUN_FULL_TESTS" ]; then
- $PYTHON ../tools/test-installed-numpy.py -v --mode=full
+ export PYTHONWARNINGS="ignore::DeprecationWarning:virtualenv"
+ $PYTHON ../tools/test-installed-numpy.py -v --mode=full $COVERAGE_FLAG
else
$PYTHON ../tools/test-installed-numpy.py -v
fi
+
+ if [ -n "$RUN_COVERAGE" ]; then
+ # Upload coverage files to codecov
+ bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy
+ fi
+
if [ -n "$USE_ASV" ]; then
pushd ../benchmarks
$PYTHON `which asv` machine --machine travis
@@ -181,4 +193,3 @@ else
setup_base
run_test
fi
-