2015-06-24 34 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