Testing sbt不识别测试
我很难让sbt(版本0.12.1)识别src/test/scala中的任何测试 我尝试过JUnit风格的测试和scalatest风格的测试,但没有成功 简化Testing sbt不识别测试,testing,sbt,junit4,Testing,Sbt,Junit4,我很难让sbt(版本0.12.1)识别src/test/scala中的任何测试 我尝试过JUnit风格的测试和scalatest风格的测试,但没有成功 简化 我已将测试移到根包(src/test/scala) 我在build.sbt中包括了org.scalatest和junit接口 libraryDependencies++=列表( “org.scalatest”%%“scalatest”%%“1.8”%”测试, com.novocode“%”junit接口“%”0.8“%”测试->默认值 )
- 我已将测试移到根包(src/test/scala)
- 我在build.sbt中包括了org.scalatest和junit接口 libraryDependencies++=列表( “org.scalatest”%%“scalatest”%%“1.8”%”测试, com.novocode“%”junit接口“%”0.8“%”测试->默认值 )
- 我已使测试尽可能简单:
- 缩放示例 导入org.scalatest.FunSuite 导入scala.collection.mutable.Stack 类ExampleSuite扩展了FunSuite{ 测试(“数学仍然有效”){ 断言(1+1==2) } }
- junit测试示例: 导入org.junit.Assert_ 导入org.junit.Test 类SimpleTest{ @试验 def testPass(){ 资产质量(1+1,2) } }
- 我的测试结构是:
src/test/scala
├── FunSuiteExample.scala └── 斯卡拉简单试验import org.junit._ import org.junit.Assert._ class SimpleTeset { @Test def testTrue() { assertEquals(1+1, 2) } }
我遗漏了什么?根据以下说明: 修改的
build.sbt
- 从build.sbt中删除了
“junit”%%“junit”%%“4.10”%%“test”
- 添加了
“com.novocode”%”junit接口“%”0.11“%”测试“
import org.junit._
import org.junit.Assert._
class SimpleTeset {
@Test
def testTrue() {
assertEquals(1+1, 2)
}
}
sbt测试的控制台输出是什么?适用于sbt 1.1.4