如何在 Eclipse 中仅执行测试并忽略测试套件?

发布于 2024-10-02 23:48:38 字数 234 浏览 7 评论 0原文

我有一个项目,它使用测试套件来调用项目中的测试。

使用 Maven 运行测试,它将仅正确运行测试。

使用 eclipse 运行测试,它同时运行测试和测试套件!

我可以编写一个 testsuite() 来调用所有包中的所有测试套件,但是有没有办法只执行项目中的测试而不执行测试套件?

部分原因是为了启用 clover 插件eclipse 报告项目的代码覆盖率

I have a project that uses testsuites to call the tests within a project.

Running the tests with maven, it will correctly runs only the tests.

Running the tests with eclipse, it runs both the tests and the testsuites!

I could write a testsuite() to call all the testsuites in all the packages but is there a way to only execute the tests in the project and not the testsuites?

Partly this is to enable the clover plugin in eclipse to report the code coverage for the project

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烛影斜 2024-10-09 23:48:38

这是 Eclipse 中所期望的。要运行测试,您必须为 Eclipse 提供一个测试类、一个包或一个项目。它将运行该选择中的所有测试和测试套件。我不相信有任何方法可以做你想做的事。

我只能建议重构,以便您的测试套件位于与测试用例不同的项目或包中。

This is expected in Eclipse. To run tests, you must either give Eclipse a test class, a package, or a project. It will run all tests and test suites in that selection. I do not believe there is any way to do what you want.

I could only suggest refactoring so that your test suites are in a different project or package from your test cases.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文