What is Import External Test Code?

Import External Test Code is a feature that imports existing GTest-based C++ test code into a CT 2025.06 project, allowing it to be executed and managed as a Code-Based Test.

Used to integrate and manage GTest-based test code written outside CT into a CT project.

Criteria for Importing External Test Code

Files that do not meet the criteria below are not shown in the importable file list.

  • The file must be a C++ source file.
  • The file must contain GTest macros (TEST, TEST_F, TEST_P).
  • Files that contain Code-Based Test macros (CTEST, CTEST_F, CTEST_P) are excluded. For such files, use the [Import Test] feature.

Importing and Running External Test Code

  1. Import External Test Code requires a C++ project that meets the following conditions.
    Requirements Description
    Project Type C++ project (C projects are not supported)
    Supported Toolchains GCC 5.0 or later
    Visual Studio 2015 or later
    Clang 8.0 or later
    Execution Environment Host Environment (Target Environment is not supported)
  1. Click the [Import] > [Test] > [Import External Test Code (GTest Compatible)] menu.
  1. Click the [Search] button to select the path or file containing the test.
  1. Link the target source file that corresponds to the external test file, and click the [OK] button.
  1. Click the [Finish] button to add the external test code to the current project.
  1. Check whether the external test code appears under the [External Tests] node in the [Code-Based Test View].In the [Code-Based Test View], select the imported test and run it.
  1. Check the execution results and coverage.

Need more help with this?
Don’t hesitate to contact us here.

Thanks for your feedback.