Hi,

I want to use JaCoCo for this Android project:
https://android.googlesource.com/platform/frameworks/volley/

But it looks that this limit rule has no effect

<limit>
  <counter>CLASS</counter>
  <value>MISSEDCOUNT</value>
  <minimum>0</minimum>
</limit>

In the project are lots of files without a test case but the build
doesn't fail.

What's wrong?



Ralph

-- 
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/54EDBA1C.2020502%40dasralph.de.
For more options, visit https://groups.google.com/d/optout.
<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";>
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.android.volley</groupId>
  <artifactId>volley</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>volley</name>
  <url>http://android.com</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <java.version>1.6</java.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.google.android</groupId>
      <artifactId>android</artifactId>
      <version>4.1.1.4</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.10</version>
    </dependency>
    <dependency>
      <groupId>org.robolectric</groupId>
      <artifactId>robolectric</artifactId>
      <version>2.2</version>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
       <artifactId>mockito-core</artifactId>
       <version>1.9.5</version>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.jayway.maven.plugins.android.generation2</groupId>
          <artifactId>android-maven-plugin</artifactId>
          <version>3.8.1</version>
          <configuration>
            <sdk>
              <platform>19</platform>
            </sdk>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.0</version>
          <configuration>
            <source>${java.version}</source>
            <target>${java.version}</target>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>debug</id>
      <activation>
        <activeByDefault>true</activeByDefault>
        <property>
          <name>performDebugBuild</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>default-test</id>
                <configuration>
                  <argLine>${surefireArgLine}</argLine>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.7.1.201405082137</version>
            <executions>
              <execution>
                <id>pre-unit-test</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
                <configuration>
                  <destFile>${project.build.directory}/surefire-reports/jacoco-ut.exec</destFile>
                  <propertyName>surefireArgLine</propertyName>
                </configuration>
              </execution>
              <execution>
                <id>jacoco-report</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>report</goal>
                  <goal>check</goal>
                </goals>
                <configuration>
                  <dataFile>${project.build.directory}/surefire-reports/jacoco-ut.exec</dataFile>
                  <outputDirectory>${project.build.directory}/jacoco-report</outputDirectory>
                  <rules>
                    <rule>
                      <element>BUNDLE</element>
                      <limits>
                        <limit>
                          <counter>INSTRUCTION</counter>
                          <value>COVEREDRATIO</value>
                          <minimum>0.40</minimum>
                        </limit>
                        <limit>
                          <counter>CLASS</counter>
                          <value>MISSEDCOUNT</value>
                          <minimum>0</minimum>
                        </limit>
                      </limits>
                    </rule>
                    <!--
                    <rule>
                      <element>CLASS</element>
                      <excludes>
                        <exclude>*Test</exclude>
                      </excludes>
                      <limits>
                        <limit>
                          <counter>LINE</counter>
                          <value>COVEREDRATIO</value>
                          <minimum>0.10</minimum>
                        </limit>
                      </limits>
                    </rule>
                    -->
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>

Reply via email to