1

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.

Alex
  • 23
  • 5
  • I don't get your problem, just call the testrunner? something like GUITestRunner.RunRegisteredTests; – whosrdaddy Dec 24 '20 at 10:06
  • 1
    I don't need to run all the tests (I have hundreds). I'm testing a new feature with my new RunTest method and I want to run its 3 test cases **only** at once (without specifying each one separately in parameter). – Alex Dec 25 '20 at 21:00

1 Answers1

1

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