Skip to content

Commit

Permalink
Add support for SonarCloud analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
droidmonkey committed Jun 21, 2018
1 parent f9eef6d commit 4e7aeca
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ release*/
*.swp

.DS_Store
.version
.version
\.scannerwork/
4 changes: 4 additions & 0 deletions cmake/CodeCoverage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname)
ENDIF() # NOT GENHTML_PATH

SET(coverage_info "${CMAKE_BINARY_DIR}/${_outputname}.info")
IF(MINGW)
# Replace C:/ with /C for MINGW
STRING(REGEX REPLACE "^([a-zA-Z]):" "/\\1" coverage_info ${coverage_info})
ENDIF()
SET(coverage_cleaned "${coverage_info}.cleaned")

SEPARATE_ARGUMENTS(test_command UNIX_COMMAND "${_testrunner}")
Expand Down
18 changes: 18 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# https://about.sonarcloud.io/get-started/
# Run the SonarCloud tools with the follow parameters:
# Run in the cmake build directory after cmake: build-wrapper-[platform]-x86-64 --out-dir bw-output make clean all
# Run in the project root directory: sonar-scanner.bat -Dsonar.cfamily.build-wrapper-output=build/bw-output -Dsonar.cfamily.gcov.reportsPath=build -Dsonar.login=[AUTH_TOKEN]

# required metadata
sonar.projectKey=keepassxc
sonar.organization=droidmonkey-github
sonar.projectName=keepassxc
sonar.host.url=https://sonarcloud.io

# path to source directories (required)
sonar.sources=src
sonar.tests=tests

sonar.cfamily.threads=2

sonar.exclusions=**/zxcvbn/*

0 comments on commit 4e7aeca

Please sign in to comment.