-
Notifications
You must be signed in to change notification settings - Fork 362
sonar.cxx.vstest.reportPaths
Sensor to read reports from the VSTest testing framework . The Visual Studio Test Platform is an open and extensible test platform that enables running tests, collect diagnostics data and report results. The Test Platform supports running tests written in various test frameworks, and using a pluggable adapter model.
Meanwhile, VSTest support is part of SonarQube. If possible sonar.cs.vstest.reportsPaths should be used.
Note: The cxx plugin itself does not run any tools, you have to do that yourself beforehand. The sensor only reads the report generated by a tool!
- Link to the tool page: https://github.com/microsoft/vstest
- The sensor supports VSTest with version TODO.
In order to generate a fitting report, make sure:
- that the paths in the report matches the
sonar.sources
andsonar.tests
lists insonar-project.properties
- the path can be absolute or relative to the project base directory
VSTest.Console.exe is the command-line tool to run tests.
Sample command lines:
vstest.console.exe myTestFile.dll /Logger:trx ...
If the tool was executed successfully, a .TRX report like the example below should be generated:
<?xml version="1.0" encoding="UTF-8"?>
<TestRun id="0ecff956-7215-452f-9ce6-2b6d45870188" name="vagrant@WIN7PRO64 2014-06-11 15:48:58" runUser="WIN7PRO64\vagrant" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Times creation="2016-03-14T17:04:31.0752743+01:00" queuing="2016-03-14T17:04:31.4447480+01:00" start="2016-03-14T17:04:31.1+01:00" finish="2016-03-14T17:04:31.9162137+01:00" />
<ResultSummary outcome="Failed">
<Counters total="43" executed="42" passed="14" failed="2" error="3" timeout="5" aborted="7" inconclusive="11" passedButRunAborted="0" notRunnable="0" notExecuted="1" disconnected="0" warning="0" completed="0" inProgress="0" pending="0" />
</ResultSummary>
</TestRun>
- First check if the file extensions read in by the cxx plugin are set (sonar.cxx.file.suffixes).
- That the paths in the report matches the
sonar.sources
andsonar.tests
lists insonar-project.properties
. - Set the analysis parameter
sonar.cxx.vstest.reportPaths
in the configuration filesonar-project.properties
of your project. The Report Paths link describes the configuration options. - Execute the SonarScanner to transfer the project with the report to the SonarQube Server.
Sample for sonar-project.properties:
sonar.cxx.vstest.reportPaths=report.trx
- If scanning is failing, check items listed under Troubleshooting Configuration.