jacoco : Cannot exclude classes

Property excludes of report goal specifies which files should be excluded from analysis during generation of report. In case of /path/tp/my/project/target/classes/META-INF/bundled-dependencies/some-third-party-1-jar-with-dependencies.jar@org/slf4j/event/EventConstants.class file is /path/tp/my/project/target/classes/META-INF/bundled-dependencies/some-third-party-1-jar-with-dependencies.jar , and the rest is about class in JAR file. Therefore as one of examples of correct configuration: <configuration> <excludes> <exclude>META-INF/**</exclude> </excludes> </configuration> As a proof having pom.xml <?xml version=”1.0″ encoding=”UTF-8″?> … Read more

Code coverage not showing results using Xcode + gcov

Thanks for all the info on stackoverfow and CubicleMuses I have code coverage working for both simulator and device! Here are the steps and configuration that worked for me: Configuration : Xcode 4 ! XCode project settings Build Settings Other Linker Flags: add “-lgcov” GCC_GENERATE_TEST_COVERAGE_FILES: Set to YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS: Set to YES C/C++ Compiler Version: … Read more

Why gcc 4.1 + gcov reports 100% branch coverage and newer (4.4, 4.6, 4.8) reports 50% for “p = new class;” line?

Solved ! We have some C/C++ files with and without exceptions handling, so lcov/gcov process “exceptions handling” for each code block. Inside a normal block, for example: int main(void) { … … [+ -] printf(“Hello\n”); … } gcov reports that printf line has a “branch coverage” of 50% —> WHY ? Because exceptions handling is … Read more

JaCoCo returning 0% Coverage with Kotlin and Android 3.0

You can get line-by-line coverage for both Java and Kotlin code by defining the two different directories for generated .class files: def debugTree = fileTree(dir: “${buildDir}/intermediates/classes/debug”, excludes: fileFilter) def kotlinDebugTree = fileTree(dir: “${buildDir}/tmp/kotlin-classes/debug”, excludes: fileFilter) Then, simply include both fileTrees in your classDirectories: classDirectories.from = files([debugTree], [kotlinDebugTree])

Perl build, unit testing, code coverage: A complete working example

It took me a while and it also took me taking small snippets from a number of different sources and melting them together, but I think I have a small working example that sufficiently demonstrates to a Perl newbie the Perl build process including unit testing and code coverage analysis & reporting. (I’m using ActiveState … Read more