On Thu, Oct 3, 2024 at 3:22 PM Marc Hoffmann <[email protected]> wrote:
> If you want to exclude classes from the report please configure the
> respective report generation tool accordingly.
Note the purpose of my project is to validate the code used in
theoretical CS research/experiments and thus for the experiments to be
valid the code needs to be trustworthy and 100% coverage is the
starting and not the ending point of this process.
Like I said the only report generating tools I have are what came with
jacoco... does this mean I have to generate CSV and finely comb it for
details when all I want is a report that says I get 100% coverage for
all non-excluded classes and methods when in fact I have 100%
coverage. Also if I understand right the above would mean that I
can't even get 100% coverage on a class that has an excluded method.
Also how do I exclude specific statements/brances such as the one this
comment relates to:
public Chunk consumeWhile(Class<?> klass)
{
SimpleChunkBuilder builder=new SimpleChunkBuilder();
// due the fact that all tape movements are managed
// by us it is impossible to contrive a trivial case
// where the false condition is covered in testing
// and the tape is completely encapsulated
// therefore Jacoco will always report a missed branch
while(pos<body.size()) {
Parseable p=peek();
if(!klass.isInstance(p))
break;
builder.add(consume());
}
return builder.toChunk();
}
Namely due to how the class is built the following will never be true
pos>=body.size() but we still need the guard condition because there
are always odd balls. So for example the coverage report for the
project says I have 100% statement coverage and 99% (1 branch missed
in 192 branches) and the offender being the above. Due to the
criticality of the app we have an iron clad rule tha all production
code needs 100% coverage of lines and branches unless there is a
comment explaining why that is not possible.
>
>
>
>
> On 3. Oct 2024, at 09:30, Aryeh Friedman <[email protected]> wrote:
>
> I am not using ant/maven or any other supported third party build/test
> coverage creation combo (i.e. roll my own) and was wondering how to
> get excludes=... really working currently it will exclude the but not
> from the HTML coverage report:
>
> #!/bin/tcsh
> #
> # Copyright (C) 2024 Aryeh M. Friedman
> # Copyright (C) 2018-2021 Friedman-Nixon-Wong Enterprises, LLC & contributors
>
> source getVersions.csh
>
> set project=`aesub '$p'`
> set tmp=/tmp/$$
> set here=`pwd`
> set sysLib=/usr/local/share/java/classes;
> #sh src/testdata/pt1.sh
>
> sudo rm -rf $here/jacoco.exec
> sudo touch $here/jacoco.exec
> sudo chmod 777 $here/jacoco.exec
>
> mkdir $tmp
> chmod 777 $tmp
> cd $tmp
>
> ln -s $here/src src
>
> sudo -u www java
> "-javaagent:$sysLib/jacocoagent.jar=destfile=$here/jacoco.exec,jmx=true,excludes=test/**"
> -cp
> $here/scrap/www/WEB-INF/lib/$project.jar:$sysLib/thisTest$thisTestVersion.jar:$sysLib/pcCommon$pcCommonVersion.jar:$sysLib/dudes-lang-common$dudeslangcommonVersion.jar
> test.TestMain
> set stat=$?
>
> cd $here
> sudo rm -rf testCoverage
> set cf="";
> foreach i (`ls -d scrap/obj/java/21/*`)
> if($i == scrap/obj/java/21/mockdata) then
> continue;
> endif
>
> if($i == scrap/obj/java/21/test) then
> continue;
> endif
>
> if($i == scrap/obj/java/21/testapps) then
> continue;
> endif
>
> set cf=`echo '--classfiles'=$i $cf`
> end
>
> sudo java -jar $sysLib/jacococli.jar report jacoco.exec $cf
> --sourcefiles=src/java --html=testCoverage --quiet
> sudo chmod -R 777 testCoverage
>
> sudo rm -rf $tmp
> exit $stat
>
>
> --
> Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org
>
> --
> 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/CAGBxaXmu0%2BJfvU%2BQL4VxKzJ5jbsCoWaW5ozSDL0Ku0gRTdO01w%40mail.gmail.com.
>
>
> --
> 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/9C683BF3-9670-40CB-9C7C-57D037654883%40mountainminds.com.
--
Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org
--
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/CAGBxaXkKZfQGMBry92v1h9xA7VEyGJ8Y4DTReb4%3D0MAzGhJOMw%40mail.gmail.com.