Sumit
Sumit

Reputation: 103

Code coverage without junit

Is it possible to use jacoco in sonar without writing junit as I have added jacoco plugin in sonarqube but when I ran the sonar scanner then it is showing 0% code coverage. Please advise me on this as I am new to this work.

Upvotes: 1

Views: 1312

Answers (2)

Kai
Kai

Reputation: 849

you can use jacoco java agent, which has nothing to do with junit, and just run your code, then report the code coverage. See this doc for more details

https://www.jacoco.org/jacoco/trunk/doc/agent.html

Upvotes: 0

benzonico
benzonico

Reputation: 10833

JaCoCo is a coverage tool that will record, during an execution of the Junit test where the execution went through your code.

So short answer is : no. This makes absolutely no sense.

(this is a bit simplified but given the question I am keeping things short here).

Upvotes: 6

Related Questions