【发布时间】:2012-12-04 04:24:00
【问题描述】:
我很难让 sbt(0.12.1 版)识别 src/test/scala 中的任何测试。
我已经尝试过 JUnit 样式测试和 scalatest 样式测试,但没有 avial
让事情变得简单
我已将测试移至根包 (src/test/scala)
我在 build.sbt 中包含了 org.scalatest 和 junit-interface libraryDependencies ++= 列表( "org.scalatest" %% "scalatest" % "1.8" % "test", “com.novocode”%“junit-interface”%“0.8”%“test->default” )
我已使测试尽可能简单:
-
最大规模的例子
导入 org.scalatest.FunSuite 导入 scala.collection.mutable.Stack
类 ExampleSuite 扩展 FunSuite {
test("数学仍然有效") { 断言(1+1 == 2) } }
-
junit 测试示例: 导入 org.junit.Assert._ 导入 org.junit.Test
类 SimpleTest {
@测试 def testPass() { assertEquals(1+1, 2) }
}
-
我的测试结构是: src/test/scala
├── FunSuiteExample.scala
└── SimpleTest.scala
我错过了什么?
【问题讨论】:
-
sbt test的控制台输出是什么?