[英]Running all testcases at once in DUnitX
I have a test with several test cases, ex:我有几个测试用例的测试,例如:
[Test]
[TestCase('Case1', '1')]
[TestCase('Case2', '2')]
[TestCase('Case3', '3')]
procedure RunTest(const aParam: integer);
I can run each test case separately including test case name in parameter, like -rMyUnit.TMyTestClass.RunTest.Case1我可以分别运行每个测试用例,包括参数中的测试用例名称,例如-rMyUnit.TMyTestClass.RunTest.Case1
My question is: how to run all test cases at once, something like -rMyUnit.TMyTestClass.RunTest.我的问题是:如何一次运行所有测试用例,例如-rMyUnit.TMyTestClass.RunTest。 *
*
I have tried without test case name, but no luck, it cannot find the test at all.我试过没有测试用例名称,但没有运气,它根本找不到测试。
It is not possible according to the code of DUnitX 2015.根据 DUnitX 2015 的代码,这是不可能的。
A workaround is to give the same test case's name for all a of one test.一种解决方法是为所有一个测试提供相同的测试用例名称。
unit rMyUnit;
interface
type
[TestFixture]
TMyTestClass = class
public
[Test]
[TestCase('CaseX', '1')]
[TestCase('CaseX', '2')]
[TestCase('CaseX', '3')]
procedure RunTest(const aParam: integer);
end;
To run these 3 test cases, run with the parameter:要运行这 3 个测试用例,请使用以下参数运行:
-run:rMyUnit.TMyTestClass.RunTest.CaseX
-运行:rMyUnit.TMyTestClass.RunTest.CaseX
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.