diff options
author | alyssaq <alyssaquek@gmail.com> | 2018-07-14 11:09:36 -0500 |
---|---|---|
committer | alyssaq <alyssaquek@gmail.com> | 2018-07-18 15:42:07 -0700 |
commit | 5eae3ece4d4cfddb3e72ac18bfc4059bdcc2f6bb (patch) | |
tree | 7a7d38dba9c691f84f0f35896ce2bee7f4fc2669 /tools | |
parent | c8b246cee7d01c45fb80f765b06abff433ff46da (diff) | |
download | numpy-5eae3ece4d4cfddb3e72ac18bfc4059bdcc2f6bb.tar.gz |
codecov integration. scipy2018 sprint.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/test-installed-numpy.py | 4 | ||||
-rwxr-xr-x | tools/travis-test.sh | 15 |
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 - |