Running DUnit Tests

Applies to TestComplete 15.64, last modified on May 16, 2024
Information in this topic applies to desktop applications only.

DUnit is a de facto testing framework that implements the Xtreme approach to software testing. It provides support for Borland Delphi 4 and later; starting from Delphi 2005, it is shipped with Delphi.

In TestComplete, you can integrate your DUnit tests to your test projects and run them as part of your automated testing process.

In the DUNit Test editor, you configure the tests to be run.

  • Your application must be compiled with the <TestComplete>\Open Apps\Delphi&BCB\tcDUnitSupport.pas unit included.

  • TestComplete must have the Delphi and C++Builder Application Support feature enabled (it is installed and enabled automatically as part of the Desktop module).

1. Prepare Your DUnit Tests
  • Copy your DUnit test files to your TestComplete computer.

2. Configure Your TestComplete Project
3. Configure the DUnit Item to Run Needed Tests
  • In Process, specify the application that contains the unit test code and runs the tests. You can either type the desired process name (only the file name, excluding extension), or press the ellipsis button and choose the desired process in the Select DUnit Process dialog.

    One application can include several unit testing classes that can contain several methods to run.

  • Select the mode you want to use to run tests:

    • To obtain and run all available tests, select Automatically load a list of tests and run all tests.

    • To run only specific tests, select Run selected tests only.

      In the Test Hierarchy, specify the list of test routines to run.

      To fill the list with unit test data from the application, click Load. TestComplete will read the unit test data and populate the Test Hierarchy list. To clear the list, click Remove. To include a method to the test run, select the check box next to the method name. To exclude the method, clear the check box.

      To include all available methods to test run, click Select All. To exclude all the methods from tests, click Unselect All.

      To invert the selection, click Invert.

4. Run the DUnit Test Item

Run the DUnit test item in TestComplete. For information on how to run unit test items, see Running Unit Tests.

TestComplete will get and launch DUnit tests of your DUnit application.

After the test run is over, view the test results.

For more information about the DUnit framework, refer to the DUnit documentation.

Alternatives to DUnit Tests

Another way of unit testing of your Delphi application is to use TCUnitTest items to organize and run unit tests in TestComplete. See TestComplete Unit Tests - Delphi Applications.

See Also

Integration With Unit Testing Frameworks
Running Unit Tests
TestComplete Unit Tests - Delphi Applications

Highlight search results