2015-06-24 33 views
2

當我執行sbt testOnly *JoinTest*沒有測試中發現並顯示以下輸出,但com.typesafe.slick.testkit.tests.JoinTest應該被執行:是否可以使用sbt testOnly和Slick TestKit?

testOnly *JoinTest* 
[info] Compiling 1 Scala source to /ext/git/slick/slick-testkit/target/scala-2.10/test-classes... 
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0 
[info] No tests to run for testkit/test:testOnly 

回答

2

你是如此接近。試試這個:

testOnly -- *JoinTest* 

--允許您測試發送參數到測試工具包。沒有它,它期待着一個JUnit測試列表。更多信息here

+1

它變得更好,不僅可以運行單個測試,還可以針對單個數據庫運行該測試:'test-only - * MyTest * h2mem *'並且如果你想要一個調試轉儲,然後附加:'-Dlog.qcomp.phases = debug -Dscala.slick.ansiDump = true'。談談一個無證的功能!在淘金網終於找到了這個來自der Zeiger的寶石:https://github.com/slick/slick/issues/818#issuecomment-44819119 – virtualeyes

0

每次當我曾呼籲一類和你.JoinTest午餐/運行其中的所有測試中,我只寫了時間:如果你想具體的運行測試用例

testOnly *.JoinTest 

link from sbt 0.13 with details about this

附加從這個類你可以使用下面的命令

testOnly *.JoinTest -- -z "test name you want to run" 

發現其他命令,你可以使用--你可以看看這個link