Skip to content

Commit

Permalink
switch to pytest for python-control on travis, combine coverage for c…
Browse files Browse the repository at this point in the history
…overalls
  • Loading branch information
bnavigator authored and roryyorke committed Apr 12, 2020
1 parent ee1f019 commit ac53a0a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
11 changes: 10 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
[run]
source = slycot
omit = */tests/*
omit =
*/tests/*
*/version.py


# please do not add any sections after this block
# the CI will add the slycot modules as last line here
[paths]
source =
slycot/
24 changes: 16 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,24 @@ install:
script:
# slycots own unit tests as installed, not those from source dir
- cd ..
- mkdir ../slycot-coverage
- cd ../slycot-coverage
- slycot_dir=$(python -c "import slycot; print(slycot.__path__[0])")
- pytest --pyargs slycot --cov=$slycot_dir --cov-config=Slycot/.coveragerc
#
# As a deeper set of tests, get test against python-control as well
- pytest --pyargs slycot --cov=$slycot_dir --cov-config=../Slycot/.coveragerc
#
# Get python-control from source and install
- git clone --depth 1 https://github.com/python-control/python-control.git control
- cd control
- python setup.py test
# As a deeper set of tests, use the suite from python-control master branch as well
- cd ..
- git clone --depth 1 https://github.com/python-control/python-control.git
- cd python-control
- pytest --disable-warnings --cov=$slycot_dir --cov-config=../Slycot/.coveragerc control/tests


after_success:
# go back to Slycot dir and merge the coverage to report correct repo data with coveralls
- cd ../Slycot
- cp ../slycot-coverage/.coverage .coverage.slycot
- cp ../python-control/.coverage .coverage.control
- echo " $slycot_dir" >> .coveragerc
- coverage combine
- coverage report
- coveralls

0 comments on commit ac53a0a

Please sign in to comment.