Output unit testing results on console using spock junit testing and gradle build system

后端 未结 2 1190
花落未央
花落未央 2021-01-13 08:49
GNU Emacs 24.3.1
Gradle 1.12
spock-core.0.7

Hello,

I am doing unit testing with spock framework using the gradle build

2条回答
  •  一向
    一向 (楼主)
    2021-01-13 08:56

    When I run my tests gradle test I just see a message like this: [...]

    By default, you'll also see (further up in the output):

    • Which test method(s) failed
    • The exception type
    • The source file and line number where the exception occurred

    To see more information, configure Test#testLogging. For example:

    tasks.withType(Test) {
        testLogging {
            exceptionFormat "full"
        }
    }
    

    For further details, check Test in the Gradle Build Language Reference.

    Then I have to go and check the xml file to see what exception has been thrown

    Typically you would check the HTML report, not the XML file. On Mac you can open the report simply by holding down CMD and double-clicking the file URL after See the report at:. Some *nix terminals offer a similar feature.

提交回复
热议问题