Merge branch 'master' into coveralls
authorPaul Brossier <piem@piem.org>
Sun, 17 Sep 2017 19:22:32 +0000 (21:22 +0200)
committerPaul Brossier <piem@piem.org>
Sun, 17 Sep 2017 19:22:32 +0000 (21:22 +0200)
.coveragerc [new file with mode: 0644]
.travis.yml
Makefile

diff --git a/.coveragerc b/.coveragerc
new file mode 100644 (file)
index 0000000..66ded4e
--- /dev/null
@@ -0,0 +1,3 @@
+[run]
+branch = True
+source = aubio
index 73aef64..7303534 100644 (file)
@@ -97,17 +97,27 @@ install:
   - travis_retry make getwaf expandwaf deps_python
   - which pip
   - pip --version
+  - pip install python-coveralls
 
 script:
   - make create_test_sounds
   - |
     if [[ -z "$AUBIO_NOTESTS" ]]; then
       make test_lib_python_clean
-      make test_python_only_clean
+      export NOSE2="coverage run --source=aubio `which nose2`"
+      make test_python_only
     else
       make test_lib_only_clean
     fi;
 
+after_success:
+  - |
+    if [[ -z "$AUBIO_NOTESTS" ]]; then
+      sed 's|\"\([^"]*\)/\(aubio\/\)\([^"]*\.py\)"|"'$PWD'/python/lib/aubio/\3"|g' .coverage > .coverage.remap
+      mv -f .coverage.remap .coverage
+      coveralls
+    fi
+
 notifications:
     irc:
         channels:
index 7e9226e..8dcbee8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -35,6 +35,9 @@ INCLUDEDIR?=$(PREFIX)/include
 DATAROOTDIR?=$(PREFIX)/share
 MANDIR?=$(DATAROOTDIR)/man
 
+# default nose2 command
+NOSE2?=nose2 -N 4 --verbose
+
 SOX=sox
 
 TESTSOUNDS := python/tests/sounds
@@ -135,9 +138,9 @@ test_python: export LD_LIBRARY_PATH=$(DESTDIR)/$(LIBDIR)
 test_python: export PYTHONPATH=$(PYDESTDIR)/$(LIBDIR)
 test_python: local_dylib
        # run test with installed package
-       ./python/tests/run_all_tests --verbose
-       # also run with nose, multiple processes
-       nose2 -N 4
+       ./python/tests/run_all_tests --verbose
+       # run with nose2, multiple processes
+       $(NOSE2)
 
 clean_python:
        ./setup.py clean