Preparing Delphi XE Applications for Testing

Applies to TestLeft 15.40, last modified on March 17, 2022

TestLeft exposes public, published, protected and private members of objects in Delphi applications if the application is compiled with debug information. This topic explains how to include debug information into applications created with Embarcadero Delphi XE.

Note: TestLeft is incompatible with tools that change the debug information format (for example, EurekaLog 7). We recommend that you disable such tools before compiling applications that will be tested with TestLeft.

The Delphi compiler can store generated debug information in separate .tds files or in the TD32 format which is compiled into the application’s binary modules.

TestLeft can work with both formats. However, we recommend that you create external .tds files for release builds of your products. This will decrease the overall size of your application. The TD32 format of debug information can be used for intermediate or special builds.

Compiling Delphi Applications With External Debug Information (TDS Files)

  1. Open your project in Embarcadero Delphi XE.

  2. Activate the configuration that you use to build the release version of your application. To do this, right-click the Project_Name | Build Configurations | Release Configuration node in the Project Manager and select Activate from the context menu.

  3. Select Project | Options from Delphi’s main menu. This will open the Project Options dialog.

  4. In the Build Configuration combo box, select your release configuration. This will quickly load the settings used for release builds.

  5. Select the Delphi Compiler | Compiling category and set the Debug information and Local symbols options to true:

    Project Options: Compiling
    Note: You can keep the Local symbols disabled, but the TestLeft UI Spy will not show the names of some method parameters.
  6. Switch to the Delphi Compiler | Linking category and set the Debug information and Place debug information in separate TDS file options to true:

    Project Options: Linking
  7. Click OK to save the changes and close the Project Options dialog.

  8. Re-build the application.

Notes:

  • The .tds files containing debug information must reside in the same folders that the appropriate modules of the tested application.

  • Even if the application is compiled with the Local symbols option enabled, the names of some method parameters may not be displayed in the TestLeft UI Spy. If viewing parameter names is important to you (for instance, if you are developing new tests), compile the tested Delphi application with internal TD32 debug information (see below).

  • There is no need to distribute the generated .tds files with your application.

Compiling Delphi Applications With Internal Debug Information (TD32)

  1. Open your project in Embarcadero Delphi XE.

  2. Activate the configuration that you use to build the debug version of your application. To do this, right-click the Project_Name | Build Configurations | Debug Configuration node in the Project Manager and select Activate from the context menu.

    Note: You can build your application in any configuration, not just in the debug one. We choose the debug configuration to make sure the changes that will be made to compiler settings will not affect the release configuration that is typically used to build the final version of applications.
  3. Choose Project | Options from the main menu to open the Project Options dialog.

  4. In the Build Configuration combo box, select your debug configuration. This will quickly load the settings used for debug builds.

  5. Select the Delphi Compiler | Compiling category and do the following:

    • In the Code generation group, set the Optimization option to false.

    • In the Debugging group, set the Debug information, Local symbols and Use debug .dcus options to true

    Project Options: Compiling
    Note: You can keep the Local symbols disabled, but the TestLeft UI Spy will not show the names of some method parameters.
  6. Switch to the Delphi Compiler | Linking category and set the Debug information option to true:

    Project Options: Linking
  7. It is recommended that you turn off the Build with runtime packages option in the Packages category:

    Project Options: Packages

    If this property is selected, Embarcadero Delphi creates Borland package library (.bpl) files when compiling the application. TestLeft cannot access debug information in these files and some controls. If this property is not selected, all information is included in a single executable and can be accessed by TestLeft.

    If, for some reason, you cannot turn off the Build with runtime packages option, TestLeft may not be able to get access to the application's internal methods and properties.
  8. Click OK to save the changes and close the Project Options dialog.

  9. Re-compile the application.

Remember to recompile the release version of your application without TD32 debug information in order to reduce the application size.

See Also

Preparing Delphi Applications for Testing

Highlight search results