From bfab3dac813aab5ca963a084e00cb0bb1e0d68a2 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 2 Aug 2016 14:04:32 +0300 Subject: [PATCH] Measure code coverage by tests // Resolve #101 --- .coveragerc | 26 ++++++++++++++++++++++++++ .gitignore | 2 ++ .travis.yml | 3 +++ README.rst | 2 ++ tox.ini | 14 +++++++++++--- 5 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..cfb6fb9d --- /dev/null +++ b/.coveragerc @@ -0,0 +1,26 @@ +# Copyright 2014-present Ivan Kravets +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +[run] +omit = + platformio/builder/* +source = platformio + +[report] +# Regexes for lines to exclude from consideration +exclude_lines = + pragma: no cover + def __repr__ + raise AssertionError + raise NotImplementedError diff --git a/.gitignore b/.gitignore index 89257136..549cf8bb 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ docs/_build dist build .cache +coverage.xml +.coverage diff --git a/.travis.yml b/.travis.yml index 0a418de9..8c34f8da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,9 @@ install: script: - tox -e $TOX_ENV +after_success: + - tox -e coverage + notifications: slack: secure: ksQmXOP5NVsf8IgoDuxD68Q/YNwDpZuwq0V29h2dxYCr38oYdAkq/Os4LSCs0X6P0cQFf6nC1hM/d+cAvU+SmzcHGxEceHNEGCg3/TAj+68KIwooPU93Lfq1zwdfteZWxANjKlCQy4+wZliHLhL8fvCYgfJww/6qKmqSYleBNM= diff --git a/README.rst b/README.rst index a3854318..3f51c344 100644 --- a/README.rst +++ b/README.rst @@ -7,6 +7,8 @@ PlatformIO .. image:: https://ci.appveyor.com/api/projects/status/dku0h2rutfj0ctls/branch/develop?svg=true :target: https://ci.appveyor.com/project/ivankravets/platformio :alt: AppVeyor.CI Build Status +.. image:: https://codecov.io/gh/platformio/platformio/branch/develop/graph/badge.svg + :target: https://codecov.io/gh/platformio/platformio .. image:: https://requires.io/github/platformio/platformio/requirements.svg?branch=develop :target: https://requires.io/github/platformio/platformio/requirements/?branch=develop :alt: Requirements Status diff --git a/tox.ini b/tox.ini index 7b32c481..39e23c8d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,4 +1,4 @@ -# Copyright 2014-2016 Ivan Kravets +# Copyright 2014-present Ivan Kravets # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -55,7 +55,15 @@ basepython = py27: python2.7 usedevelop = True passenv = * -deps = pytest +deps = + pytest + pytest-cov commands = {envpython} --version - py.test -v --basetemp="{envtmpdir}" tests + py.test --cov=platformio -v --basetemp="{envtmpdir}" tests + +[testenv:coverage] +passenv = * +basepython = python2.7 +deps = codecov +commands = codecov