如何在IntelliJ IDEA下运行所有​​Specs2测试? [英] How to run all Specs2 tests under IntelliJ IDEA?

查看:301
本文介绍了如何在IntelliJ IDEA下运行所有​​Specs2测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Scala项目中,我的Specs2测试结构如下:

In my Scala project, my Specs2 tests are structured as follows:

src/test/scala
-> my.package
---> my.package.sub1
------> SomeTest1
------> SomeTest2
---> my.package.sub2
------> SomeTest3

我正在使用SBT构建所有这些,我可以使用 sbt test 在我的包中运行所有测试。

I'm using SBT to build all of this, and I can use sbt test to run all tests in my package.

我想使用IntelliJ IDEA的内置Specs2运行配置支持。我指出它使用 my.package 中的所有测试。

I'd like to use IntelliJ IDEA's built-in Specs2 run configuration support. I point it to use all tests in my.package.

运行它会产生错误消息运行错误<运行配置名称>:未找到套件类。找不到Specs2测试套件。如果将IDA指向子包,IDEA会运行我的测试。

Running this yields the error message Error running <run config name>: Not found suite class. It cannot find Specs2 test suites. IDEA runs my tests if I point it to a subpackage.

如何配置IDEA查看所有包并运行它找到的所有测试套件?

How do I configure IDEA to look in all packages and run all the test suites it finds?

推荐答案

我已经设法在IDEA 13.1.4中运行我的所有Specs2测试,并使用运行更新的14.0.1所有包用于测试种类在整个项目中在单个模块中用于搜索测试。我将测试包字段留空了。

I've managed to run all my Specs2 tests in IDEA 13.1.4 and the more recent 14.0.1 using All in package for Test kind and In whole project or In single module for Search for tests. I left Test Package field empty.

我必须手动创建此配置。

I had to create this configuration manually.

您可能希望使用 Ctrl + Shift + F10 来创建Specs2配置,然后相应地进行修改。

You may want to use Ctrl+Shift+F10 to create a Specs2 configuration and then modify it accordingly.

这篇关于如何在IntelliJ IDEA下运行所有​​Specs2测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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