加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

scala – 如何使用SBT只运行一个Spec2规范?

发布时间:2020-12-16 09:17:05 所属栏目:安全 来源:网络整理
导读:如果您在SBT项目中定义了2个测试: class Spec1 extends Specification { def is = "Tests for specification 1" ^ p ^ "Test case 1" ! todo ^ end} 和 class Spec2 extends Specification { def is = "Tests for specification 2" ^ p ^ "Test case 2" ! t
如果您在SBT项目中定义了2个测试:

class Spec1 extends Specification {
  def is =
    "Tests for specification 1" ^
      p ^
      "Test case 1" ! todo ^
      end
}

class Spec2 extends Specification {
  def is =
    "Tests for specification 2" ^
      p ^
      "Test case 2" ! todo ^
      end
}

然后从SBT内部运行测试将执行这两个测试.运行这些测试中最简单的方法是什么?

解决方法

使用test-only sbt命令.

sbt> test-only com.example.MySpec

甚至可以使用通配符来运行一系列测试.
见In SBT,can I run only tests that match a regular expression?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读