Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: simplify test coverage analysis #1010

Merged
merged 8 commits into from
Jan 13, 2022

Conversation

arogge
Copy link
Member

@arogge arogge commented Dec 1, 2021

This PR tries to simplify analysis of test coverage in Bareos.

A new chapter is added to the documentation, describing how to analyse coverage. To simplify the whole process custom targets have been added to CMake and some minor issues have been fixed.

In the process of doing this, a test-suite for Bsnprintf() was also created.

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

General
  • PR name is meaningful
  • Purpose of the PR is understood
  • Separate commit for this PR in the CHANGELOG.md, PR number referenced is same
  • Commit descriptions are understandable and well formatted
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
  • bareos-check-sources --since-merge does not report any problems
  • git status should not report modifications in the source tree after building and testing
Tests
  • Decision taken that a system- or unittest is required (if not, then remove this paragraph)
  • Testname matches exactly what is being tested
  • Output of the test leads quickly to the origin of the fault

@pstorz pstorz changed the title Simplify test coverage analysis tests: simplify test coverage analysis Dec 23, 2021
@pstorz pstorz force-pushed the dev/arogge/master/improve-bsnprintf branch from beb53ab to 7cd8330 Compare December 23, 2021 11:20
@pstorz pstorz self-requested a review December 23, 2021 11:20
@pstorz pstorz force-pushed the dev/arogge/master/improve-bsnprintf branch 2 times, most recently from 1494e07 to 8427211 Compare December 23, 2021 11:38
Copy link
Member

@pstorz pstorz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!

arogge and others added 8 commits January 13, 2022 14:17
This patch adds two new custom targets to CMake if building with
coverage enabled.

cov-report:
  will generate a coverage report in CMAKE_BINARY_DIR/coverage

cov-clean:
  will wipe out the coverage report cov-report generates and will also
  remove the gcda files in the build tree resetting the collected
  coverage information.

Previously the ctest pretest executed the director binary which would
add misleading information to the coverage report (i.e. director code
was run wheter or not you were running a director test). This patch also
changes the pretest to just check for the executable instead of calling
it.
@pstorz pstorz force-pushed the dev/arogge/master/improve-bsnprintf branch from 4a2d35a to 0a2683f Compare January 13, 2022 13:18
@pstorz pstorz merged commit 35011e5 into bareos:master Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants