2012-02-09 73 views
3

我想通過在每次測試開始時輸出到STDOUT來跟蹤我的Grails Spock集成測試的進度。因此,在測試運行時,服務和控制器輸出的日誌數據以及顯示測試開始的輸出是混合的。有沒有一種方法可以在Grails Spock測試中輸出到STDOUT?

實施例:

開始測試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

...

回答

6
println in cleanup: 

grails test-app --echoOut 

顯示測試結束。

+0

這在Grails 2.5.3中仍然有效嗎?我試過這個,但是我沒有從服務中輸出log.info。 – Guus 2016-01-21 10:19:15

相關問題