SonarQube 5.1.1 alternative to Gallio with OpenCover

450 views Asked by At

what is the best way to use code coverage in c# with the new SonarQube 5.1.1 ?

I believe that the previous way with the following settings do not apply no more :

# Gallio  
 sonar.gallio.mode=
 sonar.gallio.installDirectory=C:\Program Files\Gallio
 sonar.gallio.runner=Local
 sonar.gallio.coverage.tool=OpenCover
 sonar.gallio.timeoutMinutes=60
 sonar.donet.visualstudio.testProjectPattern=*.Test

 #OpenCover   
 sonar.opencover.installDirectory=C:\Program Files (x86)\OpenCover

thanks in advance.

1

There are 1 answers

0
Dinesh Bolkensteyn On

You need to run OpenCover yourself, before you launch the SonarQube analysis. Then, you simply pass its report path to SonarQube so that it can import the results during the analysis.

sonar.cs.opencover.reportsPaths=results.xml

You can have a look at the example project: https://github.com/SonarSource/sonar-examples/blob/master/projects/languages/csharp/sonar-project.properties