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:
* You can study existing filter implementations [2].
* New filters needs to be registered here [2].
* Filtering is pure internal, JaCoCo has no API to add new filters. So
you will need to implement a new filter in a fork.
* I recommend to add a integration test for Ballerina first. You can
study our exiting tests for Scala [3], Kotlin [4] or Groovy [5] 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.
>
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/5ce07a65-b138-4345-8b61-889821af74de%40googlegroups.com
> [1].
Links:
------
[1]
https://groups.google.com/d/msgid/jacoco/5ce07a65-b138-4345-8b61-889821af74de%40googlegroups.com?utm_medium=email&utm_source=footer
[2]
https://github.com/jacoco/jacoco/tree/master/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter
[3]
https://github.com/jacoco/jacoco/tree/master/org.jacoco.core.test.validation.scala
[4]
https://github.com/jacoco/jacoco/tree/master/org.jacoco.core.test.validation.kotlin
[5]
https://github.com/jacoco/jacoco/tree/master/org.jacoco.core.test.validation.groovy
--
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/77e8d568cf2f73396c128481c5e77c80%40mountainminds.com.
main.class
Description: application/java-vm
