[4.4.0] Add custom test detector pattern for clover:setup

Issue #84 resolved
Marek Parfianowicz created an issue

Clover-for-Ant allows to specify custom test patterns - based on file names, class signatures and method signatures. This allows to integrate with test frameworks different than JUnit/TestNG/Spock.

<testsources>
  <testclass>
    <testmethod/>
  </testclass>
</testsources>

Clover Maven Plugin does not have this option. Create an equivalent for clover:setup/instrument/instrument-test goals.

Challenge: test sources are currently based on Maven's source roots, so maybe we could use them, but still have file inclusion/exclusion filter? If not, try to implement testclass/testmethod at least.

Comments (5)

  1. Marek Parfianowicz

    Implementation is complete in clover-core and clover-maven-plugin.

    Found one limitation, reported enhancement #96.

    Remaining work: exploratory testing (regressions in Eclipse/IDEA), website documentation.

  2. Marek Parfianowicz

    Example:

    <testSources>
        <includes>
            <include>**/*</include>
            <include>*WebTest.java</include>
            <include>**/*IT.java</include>
        </includes>
        <excludes>
            <exclude>deprecated/**</exclude>
        </excludes>
        <testClasses>
          <testClass> <!-- 0..N occurrences -->
            <name>.*Test</name>
            <super>WebTest</super>
            <annotation>@Repeat</annotation>
            <package>org\.openclover\..*</package>
            <tag>@chrome</tag>
            <testMethods> <!-- 0..N occurrences -->
                <testMethod>
                <name>check.*</name>
                <annotation>@Test</annotation>
                <tag>@web</tag>
                <returnType>void</returnType>
                </testMethod>
            </testMethods>
          </testClass>
        </testClasses>
    </testSources>
    
  3. Log in to comment