find_test_framework

Loads a test framework into a project.

Syntax

find_test_framework(
    ID <name>
    CONFIGURATION <configuration>

    ALIAS <alias>
    BSP_ALIAS <BSP alias>
)

Overview

The find_test_framework command loads a test framework into the project. VisualGDB will automatically locate the framework and install it on your computer if it was missing.

Parameters

ID
Specifies the unique ID of the test framework. The ID will be used to locate or download the framework.

CONFIGURATION
Optional. Specifies a list of <key>=<value> pairs separated by spaces. The keys and values are specific to each test framework. Use VisualGDB Project Properties commandin Solution Explorer to edit the framework configuration in a meaningful way.

ALIAS
Optional. Specifies the internal name of the CMake library created for the framework. Defaults to "TESTFW". Use when loading multiple test frameworks within the same project.

BSP_ALIAS
Optional. If the project loads multiple BSPs, this parameter allows selecting a specific BSP instance. Defaults to "BSP". Test frameworks will automatically reference the BSP, inheriting the device-specific include directories and preprocessor macros.

Examples

The following example will enable the memory usage output for all executables using the default BSP:

find_test_framework(ID com.sysprogs.unittest.tinyembtest)

add_bsp_based_executable(NAME TestExecutable
                         SOURCES TestExecutable.cpp
                         BUILD_UNIT_TESTS)

The example below references a second test framework and uses it from another test executable:

find_test_framework(ID com.sysprogs.unittest.tinyembtest
                    ALIAS SecondaryTestFramework)

add_bsp_based_executable(NAME TestExecutable2
                         SOURCES TestExecutable.cpp
                         BUILD_UNIT_TESTS
                         TESTFW_ALIAS SecondaryTestFramework)

See also

Framework-Related Statements, import_framework