Hi Marc,
Thanks for the details and I'll follow the steps. Hope it will work.. :D

On Wednesday, October 30, 2019 at 2:02:41 PM UTC+5:30, Marc R. Hoffmann 
wrote:
>
> Hi Shehan,
>
> sure, I remember. Funny ballerina bytecode helped us to fix two corner 
> cases ;)
>
> JaCoCo only reports byte code instructions. Method definitions like 
> parameters are not executable as such and not reported. I guess you want to 
> filter certain operations which happens on the Strand instance. What the 
> filters do they look for certain bytecode patterns and filter sequences of 
> byte codes when the pattern matches. Some hints:
>
>    1. You can study existing filter implementations 
>    
> <https://github.com/jacoco/jacoco/tree/master/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter>
>    . 
>    2. New filters needs to be registered here 
>    
> <https://github.com/jacoco/jacoco/tree/master/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter>
>    . 
>    3. Filtering is pure internal, JaCoCo has no API to add new filters. 
>    So you will need to implement a new filter in a fork. 
>    4. I recommend to add a integration test for Ballerina first. You can 
>    study our exiting tests for Scala 
>    
> <https://github.com/jacoco/jacoco/tree/master/org.jacoco.core.test.validation.scala>,
>  
>    Kotlin 
>    
> <https://github.com/jacoco/jacoco/tree/master/org.jacoco.core.test.validation.kotlin>
>  
>    or Groovy 
>    
> <https://github.com/jacoco/jacoco/tree/master/org.jacoco.core.test.validation.groovy>
>  
>    as starting point. 
>
> Cheers,
> -marc
>
>
> On 2019-10-30 07:29, Shehan Dhaleesha wrote:
>
> Hi, 
>  
> It's me (ballerina guy) again. Hope you already remember me. So this time 
> I need to filter out some method arguments from jacoco agent before 
> generating the jacoco.exec file. So this is a sample javap -c output of a 
> compiled ballerina program.
>
> [image: Screenshot from 2019-10-30 11-52-04.png]
>
> As you can see there is a argument 
> (org.ballerinalang.jvm.scheduling.Strand) that is passed to the main method 
> in the given program. So I need to filter that out from the jacoco.exec 
> file which means I don't need to include that argument's effect to the 
> program's coverage report. So What I've tried is introducing a filter to 
> the jacoco core/internal/analysis/filter. But I don't know how to filter 
> them out. Could you please help me on this? I really appreciate your 
> contribution as I'm stucked with this.
>
> java compiled file is attached here for more information.
>
>  
>
> Regards,
>
> Shehan.
>
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jacoco/5ce07a65-b138-4345-8b61-889821af74de%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jacoco/5ce07a65-b138-4345-8b61-889821af74de%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/ff011d9d-784d-482a-84ae-5d5dc65a0d07%40googlegroups.com.

Reply via email to