Skip to content

Commit

Permalink
add Smoketest for UTF-16LE
Browse files Browse the repository at this point in the history
  • Loading branch information
guwirth committed May 6, 2021
1 parent 1f1adc7 commit 88ebb15
Show file tree
Hide file tree
Showing 51 changed files with 94 additions and 1 deletion.
67 changes: 66 additions & 1 deletion integration-tests/features/smoketest.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Feature: Smoketests

This is for running smoketests using somewhat more complex test data.

Scenario: Smoketest
Scenario: Smoketest UTF-8
Given the project "smoketest_project"
And rule "cppcheck:unusedVariable" is activated
And rule "cppcheck:unreadVariable" is activated
Expand Down Expand Up @@ -68,6 +68,71 @@ Feature: Smoketests
| security_hotspots | 0 |


Scenario: Smoketest UTF-16LE
Given the project "smoketest_project_utf16"
And rule "cppcheck:unusedVariable" is activated
And rule "cppcheck:unreadVariable" is activated
And rule "cppcheck:deallocDealloc" is activated
And rule "cppcheck:doubleFree" is activated
And rule "cppcheck:uninitvar" is activated
And rule "cppcheck:unusedFunction" is activated
And rule "cppcheck:missingInclude" is activated
When I run sonar-scanner with "-X"
Then the analysis finishes successfully
And the analysis in server has completed
And the analysis log contains no error/warning messages except those matching:
"""
.*WARN.*Unable to get a valid mac address, will use a dummy address
.*WARN.*cannot find the sources for '#include <gtest/gtest\.h>'
.*WARN.*cannot find the sources for '#include <iostream>'
.*WARN.*Cannot find the file '.*component_XXX.cc', skipping
.*WARN.*Cannot find a report for '.*'
"""
And the following metrics have following values:
| metric | value |
| ncloc | 56 |
| lines | 151 |
| statements | 36 |
| classes | 1 |
| files | 8 |
| directories | None |
| functions | 5 |
| comment_lines_density | 30 |
| comment_lines | 24 |
| duplicated_lines_density | 55.6 |
| duplicated_lines | 84 |
| duplicated_blocks | 2 |
| duplicated_files | 2 |
| complexity | 7 |
| cognitive_complexity | 2 |
| file_complexity | 0.9 |
| violations | 12 |
| lines_to_cover | 31 |
| coverage | 53.8 |
| line_coverage | 54.8 |
| branch_coverage | 50 |
| uncovered_conditions | 4 |
| uncovered_lines | 14 |
| tests | 5 |
| test_failures | 2 |
| test_errors | 0 |
| skipped_tests | 1 |
| test_execution_time | 159 |
| test_success_density | None |
| false_positive_issues | 0 |
| open_issues | 12 |
| confirmed_issues | 0 |
| reopened_issues | 0 |
| code_smells | 6 |
| sqale_index | 30 |
| sqale_debt_ratio | 1.8 |
| bugs | 6 |
| reliability_remediation_effort | 30 |
| vulnerabilities | 0 |
| security_remediation_effort | 0 |
| security_hotspots | 0 |


Scenario: Project using Bullseye coverage, xUnit, Cppcheck, Rats, Vera++
This test verifies that analysis is able to import Bullseye coverage reports and import custom rules reports.
Custom rules are created using Rest API, after test ends rules are deleted.
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# metadata
sonar.projectKey=smoketest_project

# disable SCM support
sonar.scm.disabled=true

# disable XML sensor
sonar.xml.file.suffixes=.disable-xml

# file extensions assigned to the cxx programming language
sonar.cxx.file.suffixes=.cxx,.cpp,.cc,.c,.hxx,.hpp,.hh,.h

# comma-separated paths to directories containing source files
sonar.sources=src

# comma-separated paths to directories containing test source files
sonar.tests=tests/unittests

# comma-separated list of directories where the plugin should search for include files
sonar.cxx.includeDirectories=src,3rdparty

# paths to the reports
sonar.cxx.cppcheck.reportPaths=build/cppcheck-report.xml
sonar.cxx.cobertura.reportPaths=build/gcovr-report*.xml
sonar.cxx.cobertura.itReportPaths=build/gcovr-report*.xml
sonar.cxx.cobertura.overallReportPaths=build/gcovr-report*.xml
sonar.cxx.valgrind.reportPaths=build/valgrind-report.xml
sonar.cxx.xunit.reportPaths=build/xunit-report.xml
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified integration-tests/testdata/vs_project/reports/warnings.log
Binary file not shown.
Binary file modified integration-tests/testdata/vs_project/src/main.cpp
Binary file not shown.

0 comments on commit 88ebb15

Please sign in to comment.