简体   繁体   English

有没有一种方法可以在Grails Spock测试中输出到STDOUT?

[英]Is there a method to output to STDOUT in a Grails Spock test?

I would like to follow the progress of my Grails Spock integration test by outputting to STDOUT at the beginning of each test. 我想通过在每次测试开始时输出到STDOUT来跟踪Grails Spock集成测试的进度。 So, while the test runs, both log data output from the service and controller, and the output showing the beginning of the test is intermixed. 因此,在测试运行时,从服务和控制器输出的日志数据和显示测试开始的输出都是混合的。

Example: 例:

Starting test 1 开始测试1

2012-02-09 13:01:41,375 [main] DEBUG  - Adding included service vertex 2 to DAG

2012-02-09 13:01:41,377 [main] DEBUG  - Adding this service vertex 4f34262584ae3fec6cc2d0f0 to DAG

Starting test 2 开始测试2

2012-02-09 13:01:41,377 [main] DEBUG   - Connecting included service vertex 4f34262584ae3fec6cc2d0f0 to 2

2012-02-09 13:01:41,379 [main] DEBUG   - Added all the edges to the DAG for this service 4f34262584ae3fec6cc2d0f0

Starting test 3 开始测试3

... ...

println in cleanup:

grails test-app --echoOut

show the end of the test. 显示测试结束。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM