如何使用intellij运行多模块sbt的所有scalatest? [英] How to run all scalatest of a multi-modules sbt with intellij?

查看:91
本文介绍了如何使用intellij运行多模块sbt的所有scalatest?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以跑步:

  1. 特定的scala测试
    • 通过右键单击测试并选择run
    • 或者如果我之前已经运行过一次,请在运行菜单> run...
    • 中选择测试
  1. a specific scala test
    • either by right clicking on the test and choose run
    • or if I have run it once previously, by selecting the test in run menu > run...

但是,如果我使用scala测试(+> scala测试>测试类型...)执行与(2)相同的操作,则第一个测试很奇怪地失败了(似乎未实例化object),而同一测试如果我使用(1)或(3)运行它,则通过

But if I do the same as (2) with a scala test (+ > scala test > test kind...) the first test fails very strangely (it seems an object is not instantiated) while the same test pass if I run it using (1) or (3)

配置:

  • 具有多个子项目的sbt
  • intellij CE 15.0.2
  • scala插件2.1.0
  • scala 2.10

奖金问题:如何运行所有测试(junit和scalatest)?

Bonus question: how to run all tests (junit and scalatest)?

推荐答案

您应该能够右键单击项目的根目录,然后单击Run "All Tests".这将以递归方式搜索项目中的测试,并将在每个模块中运行测试.

You should be able to right click on the root directory of the project and click Run "All Tests". This recursively searches for tests in your project, and will run the tests in each module.

这篇关于如何使用intellij运行多模块sbt的所有scalatest?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆