Lines Matching full:test
5 ESP-IDF provides the following methods to test software.
7 …test application which runs on the {IDF_TARGET_PATH_NAME}. These tests use the `Unity <https://www…
10 Normal Test Cases
13 …test`` subdirectory of a component. Tests are written in C, and a single C source file can contain…
15 Each test file should include the ``unity.h`` header and the header for the C module to be tested.
21 TEST_CASE("test name", "[module name]"
23 // Add test here
26 - The first argument is a descriptive name for the test.
27 …s an identifier in square brackets. Identifiers are used to group related test, or tests with spec…
30 …`` and ``UNITY_END()`` in each test case. ``unity_platform.c`` will run ``UNITY_BEGIN()`` autonom…
32 …test`` subdirectory should contain a :ref:`component CMakeLists.txt <component-directories>`, sinc…
34 Overall, the minimal ``test`` subdirectory ``CMakeLists.txt`` file should contain the following:
45 Multi-device Test Cases
48 …test cases will be executed on one DUT (Device Under Test). However, components that require some …
50 The following is an example of a multi-device test case:
76 …TEST_CASE_MULTIPLE_DEVICES("gpio multiple devices test example", "[driver]", gpio_master_test, gpi…
78 The macro ``TEST_CASE_MULTIPLE_DEVICES`` is used to declare a multi-device test case.
80 - The first argument is test case name.
81 - The second argument is test case description.
82 - From the third argument, up to 5 test functions can be defined, each function will be the entry p…
84 Running test cases from different DUTs could require synchronizing between DUTs. We provide ``unity…
98 Multi-stage Test Cases
101 …test cases are expected to finish without reset (or only need to check if reset happens). Sometime…
117 Multi-stage test cases present a group of test functions to users. It needs user interactions (sele…
124 1. Wrap your test code by ``!(TEMPORARY_)DISABLED_FOR_TARGETS()`` macros and place them either in t…
127 TEST_CASE("a test that is not ready for esp32 and esp8266 yet", "[]")
143 2. For test code that you are 100% for sure that will not be supported (e.g. no peripheral at all),…
147 …test code under ``test/target`` folder and use CMakeLists.txt to choose one of the target folder. …
149 …test items any more. This makes it harder to track disabled tests and enable them again. Also, a b…
151 - Test item: some items that will be performed on some targets, but skipped on other targets. E.g.
153 …There are three test items SD 1-bit, SD 4-bit and SDSPI. For ESP32-S2, which doesn't have SD host,…
155 - Test implementation: some code will always happen, but in different ways. E.g.
157 …on ESP8266. If you want to get the length from the slave as a step in the test process, you can ha…
159 …But please avoid using ``#else`` macro. When new target is added, the test case will fail at build…
161 Building Unit Test App
166 Change into ``tools/unit-test-app`` directory to configure and build it:
168 * ``idf.py menuconfig`` - configure unit test app.
169 * ``idf.py -T all build`` - build unit test app with tests for each component having tests in the `…
170 * ``idf.py -T "xxx yyy" build`` - build unit test app with tests for some space-separated specific …
171 * ``idf.py -T all -E "xxx yyy" build`` - build unit test app with all unit tests, except for unit t…
175 …ws command prompt, following syntax has to be used in order to build unit-test-app with multiple c…
186 After flashing reset the {IDF_TARGET_NAME} and it will boot the unit test app.
188 When unit test app is idle, press "Enter" will make it print test menu with all available tests::
190 Here's the test menu, pick your combo:
194 (4) "Verify unit test app image" [bootloader_support]
203 (13) "gpio master/slave test example" [ignore][misc][test_env=UT_T2_1][multi_device]
207 (15) "SPI Master test" [spi][ignore]
208 (16) "SPI Master test, interaction of multiple devs" [spi][ignore]
210 (18) "SPI Master DMA test, TX and RX in different regions" [spi]
211 (19) "SPI Master DMA test: length, start, not aligned" [spi]
216 … description. Master-slave cases will also print the sub-menu (the registered test function names).
218 Test cases can be run by inputting one of the following:
220 - Test case name in quotation marks to run a single test case
222 - Test case index to run a single test case
224 - Module name in square brackets to run all test cases for a specific module
226 - An asterisk to run all test cases
228 …and ``[multi_stage]`` tags tell the test runner whether a test case is a multiple devices or multi…
230 After you select a multi-device test case, it will print sub-menu::
232 Running gpio master/slave test example...
233 gpio master/slave test example
237 You need to input a number to select the test running on the DUT.
239 Similar to multi-device test cases, multi-stage test cases will also print sub-menu::
246 …un first stage (trigger deepsleep). After DUT is rebooted and able to run test cases, select this …
287 - Decreased test reliability due to lower layer components and/or hardware setup.
291 … component, (i.e., the component under test), software mocking allows the dependencies of the comp…
293 …nder test is dependent on should be mocked, thus allowing the test environment complete control ov…
296 …creases the dependency on the "real" code's behavior. Furthermore, once a test fails, you may not …
297 …-evaluate the design of the code under test and attempt to reduce its dependencies by dividing the…
343 …s not have to mock the original component in its entirety. As long as the test project's dependenc…
347 Adjustments in Unit Test
350 The unit test needs to inform the cmake build system to mock dependent components (i.e., it needs t…
358 Users should refer to the ``esp_event`` host-based unit test and its :component_file:`esp_event/hos…