as a developer I'd like to have Spock @Unroll annotation being recognized by Clover

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Fixed
    • 3.3.0
    • Component/s: Groovy
    • None

      The

      @Unroll

      annotation causes that a test name will be unrolled for every combination of test data. It means that we can have multiple tests having different name, which in fact are related with exactly the same test method, but ran with different input arguments.

      Examples (from http://docs.spockframework.org/en/latest/data_driven_testing.html):

      // sequence index at the end
      @Unroll
      def "maximum of two numbers"() { ... }
      maximum of two numbers[0]   PASSED
      maximum of two numbers[1]   FAILED
      
      // variable substitution 
      @Unroll
      def "maximum of #a and #b is #c"() { ... }
      maximum of 3 and 5 is 5   PASSED
      maximum of 7 and 0 is 7   FAILED
      

      Problem for Clover: we don't know neither a number of tests nor their names during compilation. it would have to be deferred to runtime.

      => add some inner class for a test class which would monitoring the test name and somehow pass to the per-test coverage recorder?

            Assignee:
            Marek Parfianowicz
            Reporter:
            Marek Parfianowicz
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: