我想通过在每次测试开始时输出到 STDOUT 来跟踪我的 Grails Spock 集成测试的进度。因此,在测试运行时,服务和 Controller 的日志数据输出与显示测试开始的输出混合在一起。
例子:
开始测试 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
开始测试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
开始测试 3
...
最佳答案
println in cleanup:
grails test-app --echoOut
显示测试结束。
关于testing - 在 Grails Spock 测试中是否有输出到 STDOUT 的方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9218006/