Skip to content

Commit

Permalink
Merge pull request #845 from guwirth/sonar-scanner-2.6
Browse files Browse the repository at this point in the history
use sonar-scanner V2.6
  • Loading branch information
guwirth committed Apr 26, 2016
2 parents b4676f3 + 44e51aa commit 955ba16
Show file tree
Hide file tree
Showing 17 changed files with 48 additions and 48 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ install:
- unzip -qq sonarqube-5.4.zip
- travis_retry wget -q https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-5.5-RC1.zip
- unzip -qq sonarqube-5.5-RC1.zip
- travis_retry wget -q https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-2.5.1.zip
- unzip -qq sonar-scanner-2.5.1.zip
- travis_retry wget -q https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-2.6.zip
- unzip -qq sonar-scanner-2.6.zip
- cd -

before_script:
Expand All @@ -39,7 +39,7 @@ before_script:
script:
- mvn install -DskipTests=true
- mvn test
- RAILS_ENV=production PATH=$PATH:/tmp/sonar-scanner-2.5.1/bin TestDataFolder=~/build/SonarOpenCommunity/sonar-cxx/integration-tests/testdata behave --no-capture
- RAILS_ENV=production PATH=$PATH:/tmp/sonar-scanner-2.6/bin TestDataFolder=~/build/SonarOpenCommunity/sonar-cxx/integration-tests/testdata behave --no-capture

after_failure:
- cat $SONARHOME/logs/sonar.log
Expand Down
10 changes: 5 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ install:
)
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\maven-bin.zip", "C:\maven")
}
if (!(Test-Path -Path "C:\sonar-runner" )) {
if (!(Test-Path -Path "C:\sonar-scanner" )) {
(new-object System.Net.WebClient).DownloadFile(
'https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-2.5.1.zip',
'C:\sonar-runner-dist.zip'
'https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-2.6.zip',
'C:\sonar-scanner-dist.zip'
)
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\sonar-runner-dist.zip", "C:\sonar-runner")
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\sonar-scanner-dist.zip", "C:\sonar-scanner")
}
if (!(Test-Path -Path "C:\sonarqube-5.4" )) {
(new-object System.Net.WebClient).DownloadFile(
Expand All @@ -37,7 +37,7 @@ install:
$env:VCVARS_PLATFORM="amd64"
$env:LANG_PLATFORM="-x64"
}
- cmd: SET PATH=C:\maven\apache-maven-3.2.5\bin;%JAVA_HOME%\bin;C:\sonar-runner\sonar-scanner-2.5.1\bin;%PATH%
- cmd: SET PATH=C:\maven\apache-maven-3.2.5\bin;%JAVA_HOME%\bin;C:\sonar-scanner\sonar-scanner-2.6\bin;%PATH%
- cmd: SET SONARHOME=C:\sonarqube-5.4\sonarqube-5.4
- cmd: SET TestDataFolder=C:\projects\sonar-cxx\integration-tests\testdata
- cmd: SET
Expand Down
6 changes: 3 additions & 3 deletions cxx-squid/src/test/resources/compiler/vc++13.txt

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions integration-tests/features/importing_coverage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Importing coverage data
Scenario: Importing coverage reports
GIVEN the project "coverage_project"

WHEN I run sonar-runner with following options:
WHEN I run sonar-scanner with following options:
"""
-Dsonar.cxx.coverage.reportPath=ut-coverage.xml
-Dsonar.cxx.coverage.itReportPath=it-coverage.xml
Expand Down Expand Up @@ -39,7 +39,7 @@ Feature: Importing coverage data
Scenario: Importing coverage reports zeroing coverage for untouched files
GIVEN the project "coverage_project"

WHEN I run sonar-runner with following options:
WHEN I run sonar-scanner with following options:
"""
-Dsonar.cxx.coverage.reportPath=ut-coverage.xml
-Dsonar.cxx.coverage.itReportPath=it-coverage.xml
Expand Down Expand Up @@ -77,7 +77,7 @@ Feature: Importing coverage data

GIVEN the project "coverage_project"

WHEN I run sonar-runner with following options:
WHEN I run sonar-scanner with following options:
"""
-Dsonar.cxx.coverage.reportPath=dummy.xml
-Dsonar.cxx.coverage.itReportPath=dummy.xml
Expand Down
14 changes: 7 additions & 7 deletions integration-tests/features/importing_cppcheck_reports.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Importing Cppcheck reports

Scenario Outline: Importing Cppcheck report(s)
GIVEN the project "cppcheck_project"
WHEN I run "sonar-runner -X -Dsonar.cxx.cppcheck.reportPath=<reportpath>"
WHEN I run "sonar-scanner -X -Dsonar.cxx.cppcheck.reportPath=<reportpath>"
THEN the analysis finishes successfully
AND the analysis in server has completed
AND the server log (if locatable) contains no error/warning messages
Expand All @@ -26,7 +26,7 @@ Feature: Importing Cppcheck reports
Scenario: The reports are missing
GIVEN the project "cppcheck_project"
WHEN I run "sonar-runner -X -Dsonar.cxx.cppcheck.reportPath=empty.xml"
WHEN I run "sonar-scanner -X -Dsonar.cxx.cppcheck.reportPath=empty.xml"
THEN the analysis finishes successfully
AND the analysis in server has completed
AND the server log (if locatable) contains no error/warning messages
Expand All @@ -39,7 +39,7 @@ Feature: Importing Cppcheck reports
@wip
Scenario: The report mentions an unknown rule
GIVEN the project "cppcheck_project"
WHEN I run "sonar-runner -X -Dsonar.cxx.cppcheck.reportPath=rule_unknown.xml"
WHEN I run "sonar-scanner -X -Dsonar.cxx.cppcheck.reportPath=rule_unknown.xml"
THEN the analysis finishes successfully
AND the analysis in server has completed
AND the server log (if locatable) contains no error/warning messages
Expand All @@ -52,7 +52,7 @@ Feature: Importing Cppcheck reports
Scenario Outline: The reports are invalid
GIVEN the project "cppcheck_project"
WHEN I run "sonar-runner -X -Dsonar.cxx.cppcheck.reportPath=<reportpath>"
WHEN I run "sonar-scanner -X -Dsonar.cxx.cppcheck.reportPath=<reportpath>"
THEN the analysis finishes successfully
AND the analysis in server has completed
AND the server log (if locatable) contains no error/warning messages
Expand All @@ -70,7 +70,7 @@ Feature: Importing Cppcheck reports

Scenario: The reports use paths relative to directories listed in sonar.sources
GIVEN the project "cppcheck_project"
WHEN I run "sonar-runner -X -Dsonar.cxx.cppcheck.reportPath=relative-to-src.xml"
WHEN I run "sonar-scanner -X -Dsonar.cxx.cppcheck.reportPath=relative-to-src.xml"
THEN the analysis finishes successfully
AND the analysis in server has completed
AND the server log (if locatable) contains no error/warning messages
Expand All @@ -83,7 +83,7 @@ Feature: Importing Cppcheck reports
Scenario: The reports and issues in the reports have absolute paths
GIVEN the project "cppcheck_with_absolute_paths_project"
and platform is not "Windows"
WHEN I run "sonar-runner -X"
WHEN I run "sonar-scanner -X"
THEN the analysis finishes successfully
AND the analysis in server has completed
AND the server log (if locatable) contains no error/warning messages
Expand All @@ -95,7 +95,7 @@ Feature: Importing Cppcheck reports
# Scenario: The reports are outside the project directory
# GIVEN the project "cppcheck_project"
# AND a report outside the projects directory, e.g. "/tmp/cppcheck-v1.xml"
# WHEN I run "sonar-runner -X -Dsonar.cxx.cppcheck.reportPath=/tmp/cppcheck-v1.xml"
# WHEN I run "sonar-scanner -X -Dsonar.cxx.cppcheck.reportPath=/tmp/cppcheck-v1.xml"
# THEN the analysis finishes successfully
# AND the analysis in server has completed
# AND the server log (if locatable) contains no error/warning messages
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/features/multimodule_analysis.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Feature: cpp-multimodule-project

Scenario: cpp-multimodule-project
GIVEN the project "cpp-multimodule-project"
WHEN I run "sonar-runner -X"
WHEN I run "sonar-scanner -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:
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/features/multimodule_analysis_2.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: cpp-multimodule-project
GIVEN the project "cpp-multimodule-project-2"
and platform is not "Windows"

WHEN I run "sonar-runner -X"
WHEN I run "sonar-scanner -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:
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/features/smoketest.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Feature: Smoketest

Scenario: Smoketest
GIVEN the project "smoketest_project"
WHEN I run "sonar-runner"
WHEN I run "sonar-scanner"
THEN the analysis finishes successfully
AND the analysis in server has completed
AND the analysis log contains no error/warning messages except those matching:
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/features/steps/test_execution_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,10 @@ def step_impl(context):
shutil.copyfile(source, target)


@when(u'I run sonar-runner with following options')
@when(u'I run sonar-scanner with following options')
def step_impl(context):
arguments = [line for line in context.text.split("\n") if line != '']
command = "sonar-runner " + " ".join(arguments)
command = "sonar-scanner " + " ".join(arguments)
_run_command(context, command)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: GoogleTestWithBullseyeAndVsProject

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.
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.
Bullseye reports need to be created before running the test.

Scenario: GoogleTestWithBullseyeAndVsProject
Expand All @@ -13,7 +13,7 @@ Feature: GoogleTestWithBullseyeAndVsProject
and rule "cpplint_whitespace_parens_5" is created based on "other:CustomRuleTemplate" in repository "other"
and rule "cpplint_whitespace_line_length_1" is created based on "other:CustomRuleTemplate" in repository "other"
and rule "cpplint_tekla_custom_include_files_0" is created based on "other:CustomRuleTemplate" in repository "other"
WHEN I run "sonar-runner -X"
WHEN I run "sonar-scanner -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:
Expand Down
26 changes: 13 additions & 13 deletions integration-tests/features/test_execution_statistics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Feature: Providing test execution numbers

GIVEN the project "googletest_project"

WHEN I run "sonar-runner -X -Dsonar.cxx.xunit.reportPath=gtest_without_fixture.xml"
WHEN I run "sonar-scanner -X -Dsonar.cxx.xunit.reportPath=gtest_without_fixture.xml"

THEN the analysis finishes successfully
AND the analysis in server has completed
Expand Down Expand Up @@ -82,7 +82,7 @@ Feature: Providing test execution numbers
in the AST'-approach. This doesn't work for all testcases, though

GIVEN the project "googletest_project"
WHEN I run "sonar-runner -X -Dsonar.cxx.xunit.reportPath=<reportpath> -Dsonar.cxx.xunit.provideDetails=true"
WHEN I run "sonar-scanner -X -Dsonar.cxx.xunit.reportPath=<reportpath> -Dsonar.cxx.xunit.provideDetails=true"
THEN the analysis finishes successfully
AND the analysis in server has completed
AND the analysis log contains no error/warning messages except those matching:
Expand Down Expand Up @@ -110,7 +110,7 @@ Feature: Providing test execution numbers
see above... this is the case where it doesnt work

GIVEN the project "googletest_project"
WHEN I run "sonar-runner -X -Dsonar.cxx.xunit.reportPath=<reportpath> -Dsonar.cxx.xunit.provideDetails=true"
WHEN I run "sonar-scanner -X -Dsonar.cxx.xunit.reportPath=<reportpath> -Dsonar.cxx.xunit.provideDetails=true"
THEN the analysis finishes successfully
AND the analysis in server has completed
AND the analysis log contains no error/warning messages except those matching:
Expand All @@ -136,7 +136,7 @@ Feature: Providing test execution numbers
Importing in detailled mode isnt possible unless sonar.tests is set

GIVEN the project "googletest_project"
WHEN I run "sonar-runner -X -Dsonar.cxx.xunit.reportPath=<reportpath> -Dsonar.cxx.xunit.provideDetails=true -Dsonar.tests="
WHEN I run "sonar-scanner -X -Dsonar.cxx.xunit.reportPath=<reportpath> -Dsonar.cxx.xunit.provideDetails=true -Dsonar.tests="
THEN the analysis finishes successfully
AND the analysis in server has completed
AND the analysis log contains a line matching:
Expand All @@ -159,7 +159,7 @@ Feature: Providing test execution numbers
correct source code files.

GIVEN the project "googletest_project"
WHEN I run "sonar-runner -X -Dsonar.cxx.xunit.reportPath=<reportpath>"
WHEN I run "sonar-scanner -X -Dsonar.cxx.xunit.reportPath=<reportpath>"
THEN the analysis finishes successfully
AND the analysis in server has completed
AND the analysis log contains no error/warning messages except those matching:
Expand All @@ -186,7 +186,7 @@ Feature: Providing test execution numbers
Scenario Outline: googletest reports cannot be found or are empty
GIVEN the project "googletest_project"
WHEN I run "sonar-runner -Dsonar.cxx.xunit.reportPath=<reportpath>"
WHEN I run "sonar-scanner -Dsonar.cxx.xunit.reportPath=<reportpath>"
THEN the analysis finishes successfully
AND the analysis in server has completed
AND the analysis log contains no error/warning messages except those matching:
Expand Down Expand Up @@ -214,7 +214,7 @@ Feature: Providing test execution numbers

Scenario: googletest report is invalid
GIVEN the project "googletest_project"
WHEN I run "sonar-runner -Dsonar.cxx.xunit.reportPath=invalid_report.xml"
WHEN I run "sonar-scanner -Dsonar.cxx.xunit.reportPath=invalid_report.xml"
THEN the analysis breaks
AND the analysis log contains a line matching:
"""
Expand All @@ -235,7 +235,7 @@ Feature: Providing test execution numbers

GIVEN the project "boosttest_project"

WHEN I run "sonar-runner -X -Dsonar.cxx.xunit.reportPath=btest_test_simple-test_suite.xml"
WHEN I run "sonar-scanner -X -Dsonar.cxx.xunit.reportPath=btest_test_simple-test_suite.xml"

THEN the analysis finishes successfully
AND the analysis in server has completed
Expand All @@ -261,7 +261,7 @@ Feature: Providing test execution numbers

GIVEN the project "boosttest_project"

WHEN I run "sonar-runner -X -Dsonar.cxx.xunit.reportPath=btest_test_nested-test_suite.xml"
WHEN I run "sonar-scanner -X -Dsonar.cxx.xunit.reportPath=btest_test_nested-test_suite.xml"

THEN the analysis finishes successfully
AND the analysis in server has completed
Expand All @@ -288,7 +288,7 @@ Feature: Providing test execution numbers

GIVEN the project "boosttest_project"

WHEN I run "sonar-runner -X -Dsonar.cxx.xunit.xsltURL=boosttest-1.x-to-junit-dummy-1.0.xsl -Dsonar.tests=cxx-xunit -Dsonar.cxx.xunit.provideDetails=true -Dsonar.cxx.xunit.reportPath=btest_test_nested-test_suite.xml"
WHEN I run "sonar-scanner -X -Dsonar.cxx.xunit.xsltURL=boosttest-1.x-to-junit-dummy-1.0.xsl -Dsonar.tests=cxx-xunit -Dsonar.cxx.xunit.provideDetails=true -Dsonar.cxx.xunit.reportPath=btest_test_nested-test_suite.xml"

THEN the analysis finishes successfully
AND the analysis in server has completed
Expand All @@ -314,7 +314,7 @@ Feature: Providing test execution numbers

GIVEN the project "boosttest_project"

WHEN I run "sonar-runner -X -Dsonar.cxx.xunit.reportPath=<reportpath> -Dsonar.cxx.xunit.provideDetails=true"
WHEN I run "sonar-scanner -X -Dsonar.cxx.xunit.reportPath=<reportpath> -Dsonar.cxx.xunit.provideDetails=true"
THEN the analysis finishes successfully
AND the analysis in server has completed
AND the analysis log contains no error/warning messages except those matching:
Expand Down Expand Up @@ -350,7 +350,7 @@ Feature: Providing test execution numbers

GIVEN the project "boosttest_project"

WHEN I run "sonar-runner -X -Dsonar.cxx.xunit.reportPath=<reportpath> -Dsonar.cxx.xunit.provideDetails=true"
WHEN I run "sonar-scanner -X -Dsonar.cxx.xunit.reportPath=<reportpath> -Dsonar.cxx.xunit.provideDetails=true"
THEN the analysis finishes successfully
AND the analysis in server has completed
AND the analysis log contains no error/warning messages except those matching:
Expand Down Expand Up @@ -382,7 +382,7 @@ Feature: Providing test execution numbers
GIVEN the project "boosttest_project"
and platform is not "Windows"

WHEN I run "sonar-runner -X -Dsonar.cxx.xunit.reportPath=btest_test_nested-test_suite.xml -Dsonar.cxx.xunit.provideDetails=true -Dsonar.cxx.includeDirectories=/usr/include"
WHEN I run "sonar-scanner -X -Dsonar.cxx.xunit.reportPath=btest_test_nested-test_suite.xml -Dsonar.cxx.xunit.provideDetails=true -Dsonar.cxx.includeDirectories=/usr/include"
THEN the analysis finishes successfully
AND the analysis in server has completed
AND the analysis log contains no error/warning messages except those matching:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
<!-- this is just a ack to make the bulleye report relative so that i can be used in other environments -->
<Exec Command="sed -b -i 's/e:\/Development\/SonarQube\/cxx\/sonar-cxx\/integration-tests\/testdata\/googletest_bullseye_vs_project\//.\//g' sonarcpp\bullseye-coverage-results\bullseyecoverage-result-0.xml" ContinueOnError="WarnAndContinue"/>
<Exec Command="cov01 -0" ContinueOnError="WarnAndContinue"/>
<Exec Command="sonar-runner -X" ContinueOnError="WarnAndContinue"/>
<Exec Command="sonar-scanner -X" ContinueOnError="WarnAndContinue"/>
</Target>
</Project>
2 changes: 1 addition & 1 deletion integration-tests/testdata/cppcheck_project/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ cppcheck_relative_to_src:
cd src; cppcheck -v --enable=all --xml --xml-version=1 . -I. 2> ../relative-to-src.xml; cd -

sonar_sonar:
sonar-runner -X
sonar-scanner -X
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
<!-- this is just a ack to make the bulleye report relative so that i can be used in other environments -->
<Exec Command="sed -b -i 's/e:\/Development\/SonarQube\/cxx\/sonar-cxx\/integration-tests\/testdata\/googletest_bullseye_vs_project\//.\//g' sonarcpp\bullseye-coverage-results\bullseyecoverage-result-0.xml" ContinueOnError="WarnAndContinue"/>
<Exec Command="cov01 -0" ContinueOnError="WarnAndContinue"/>
<Exec Command="sonar-runner -X" ContinueOnError="WarnAndContinue"/>
<Exec Command="sonar-scanner -X" ContinueOnError="WarnAndContinue"/>
</Target>
</Project>
2 changes: 1 addition & 1 deletion integration-tests/testdata/smoketest_project/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ sonar_coverage:

# Parse collected data and feed it into sonar
sonar_sonar:
sonar-runner -X
sonar-scanner -X
2 changes: 1 addition & 1 deletion sonar-cxx-plugin/src/samples/SampleProject2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ sonar_coverage:

# Parse collected data and feed it into sonar
sonar_sonar:
sonar-runner -X
sonar-scanner -X
2 changes: 1 addition & 1 deletion sonar-cxx-plugin/src/samples/SampleProject2/Readme
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ with your code.
It assumes following software to be installed:
- gcc
- make
- java, sonar-runner
- java, sonar-scanner
- cppcheck
- valgrind
- Python, gcovr.py
Expand Down

0 comments on commit 955ba16

Please sign in to comment.