Alex
Alex

Reputation: 23

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

My question is: how to run all test cases at once, something like -rMyUnit.TMyTestClass.RunTest.*

I have tried without test case name, but no luck, it cannot find the test at all.

Upvotes: 1

Views: 306

Answers (1)

Stephane BEAUFORT
Stephane BEAUFORT

Reputation: 448

It is not possible according to the code of 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 :

-run:rMyUnit.TMyTestClass.RunTest.CaseX

Upvotes: 1

Related Questions