This example demonstrates:
- The concepts of lines to cover and conditions to cover (different from LoC/Lines)
- The calculation of line, condition and overall coverage.
- Some rules/issues on test files
- Run
build.sh
to build and analyze 3 different branches of the projects:master
,partial-coverage
,partial-coverage-2
andissue-on-test-files
- This creates a project in SonarQube called Training: Coverage
- Each branch of the project has a different coverage due to a different set of tests
master
has 2 tests (test1 and test2) that yield 100% coveragepartial-coverage
branch has 1 test (test1) that yields 85.7% coveragepartial-coverage-2
branch has 1 test (test2) that yields 71.4% coverageissue-on-tests-files
is a branch to show SonarQube rules specific for tests. It shows an issue on a test file that's improperly written