5 https://git.automotivelinux.org/apps/app-afb-test/plain/docs/2_The_test_widget.md?h=master
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/app-afb-test-developer-guides-api-services-book.yml -->
10 # How to build the test widget using app-templates/cmake-apps-module
12 ## Defining CMake targets
14 Now that the test tree has been created, in each directory you have to create
15 a `CMakeLists.txt` file to hold the CMake's target definition. For each target
16 you need to specify a **LABELS** depending on the purpose of the files for each
17 directory. There are more explanations about using the *cmake-apps-module* (the
18 former *app-templates* submodule) in the [documentation website](../../../devguides/reference/cmakeafbtemplates/dev_guide/advanced-usage.html).
20 Here is a cheat sheet to map the **LABELS** target for each classic test tree
23 * `etc` uses the label **TEST-CONFIG**
24 * `fixtures` uses the label **TEST-DATA**
25 * `tests` uses the label **TEST-DATA**
27 i.e for the `etc` folder:
30 PROJECT_TARGET_ADD(afb-test-config)
32 file(GLOB CONF_FILES "*.json")
34 add_input_files("${CONF_FILES}")
36 SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
38 OUTPUT_NAME ${TARGET_NAME}
42 > **CAUTION**: make sure that you have CMakeLists files that include your
43 > subdirectories target (cf: previous chapter `Write the tests`).
45 ## Build the test widget
47 By default, the test widget is not built, you have to specify that you want to
48 build it or use a special target.
50 ### Building at the same time than classic widget
52 Specify the option `BUILD_TEST_WGT=TRUE` when you configure your build.
58 cmake -DBUILD_TEST_WGT=TRUE ..
63 ### Building separately only the test widget
65 Just use the target `test_widget` after a classic build.