|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| CMakeLists.txt | D | 11-Mar-2024 | 25.6 KiB | 1,343 | 1,054 |
| README.md | D | 11-Mar-2024 | 1.5 KiB | 58 | 38 |
| test_address_sanitizer.cpp | D | 11-Mar-2024 | 1.9 KiB | 48 | 14 |
| test_aes.cpp | D | 11-Mar-2024 | 9.8 KiB | 268 | 164 |
| test_array.cpp | D | 11-Mar-2024 | 12.7 KiB | 432 | 291 |
| test_binary_search.cpp | D | 11-Mar-2024 | 3.7 KiB | 101 | 52 |
| test_checksum.cpp | D | 11-Mar-2024 | 16.8 KiB | 483 | 299 |
| test_child.cpp | D | 11-Mar-2024 | 12 KiB | 353 | 234 |
| test_child_table.cpp | D | 11-Mar-2024 | 13.9 KiB | 404 | 273 |
| test_cmd_line_parser.cpp | D | 11-Mar-2024 | 16.3 KiB | 367 | 279 |
| test_data.cpp | D | 11-Mar-2024 | 7.6 KiB | 213 | 145 |
| test_dns.cpp | D | 11-Mar-2024 | 71.2 KiB | 1,683 | 1,234 |
| test_dns_client.cpp | D | 11-Mar-2024 | 41.7 KiB | 1,139 | 755 |
| test_dso.cpp | D | 11-Mar-2024 | 50.5 KiB | 1,238 | 913 |
| test_ecdsa.cpp | D | 11-Mar-2024 | 8.4 KiB | 198 | 124 |
| test_flash.cpp | D | 11-Mar-2024 | 5.8 KiB | 197 | 119 |
| test_frame_builder.cpp | D | 11-Mar-2024 | 10.1 KiB | 225 | 158 |
| test_hdlc.cpp | D | 11-Mar-2024 | 29.2 KiB | 659 | 450 |
| test_heap.cpp | D | 11-Mar-2024 | 5.5 KiB | 190 | 112 |
| test_heap_array.cpp | D | 11-Mar-2024 | 15.4 KiB | 495 | 346 |
| test_heap_string.cpp | D | 11-Mar-2024 | 11 KiB | 332 | 229 |
| test_hkdf_sha256.cpp | D | 11-Mar-2024 | 8.9 KiB | 172 | 106 |
| test_hmac_sha256.cpp | D | 11-Mar-2024 | 11.1 KiB | 294 | 199 |
| test_ip4_header.cpp | D | 11-Mar-2024 | 5.5 KiB | 133 | 84 |
| test_ip6_header.cpp | D | 11-Mar-2024 | 5.7 KiB | 141 | 89 |
| test_ip_address.cpp | D | 11-Mar-2024 | 35.2 KiB | 894 | 679 |
| test_link_metrics_manager.cpp | D | 11-Mar-2024 | 8.2 KiB | 223 | 144 |
| test_link_quality.cpp | D | 11-Mar-2024 | 18.4 KiB | 547 | 377 |
| test_linked_list.cpp | D | 11-Mar-2024 | 14.9 KiB | 447 | 324 |
| test_lowpan.cpp | D | 11-Mar-2024 | 78.8 KiB | 2,099 | 1,250 |
| test_lowpan.hpp | D | 11-Mar-2024 | 9.1 KiB | 291 | 105 |
| test_mac_frame.cpp | D | 11-Mar-2024 | 31.3 KiB | 784 | 553 |
| test_macros.cpp | D | 11-Mar-2024 | 4.9 KiB | 149 | 82 |
| test_meshcop.cpp | D | 11-Mar-2024 | 7 KiB | 165 | 105 |
| test_message.cpp | D | 11-Mar-2024 | 17.3 KiB | 437 | 289 |
| test_message_queue.cpp | D | 11-Mar-2024 | 12.7 KiB | 355 | 224 |
| test_mle.cpp | D | 11-Mar-2024 | 7.4 KiB | 187 | 121 |
| test_multicast_listeners_table.cpp | D | 11-Mar-2024 | 7.4 KiB | 201 | 120 |
| test_multipan_rcp_instances.cpp | D | 11-Mar-2024 | 23.5 KiB | 767 | 550 |
| test_nat64.cpp | D | 11-Mar-2024 | 14.6 KiB | 315 | 216 |
| test_ndproxy_table.cpp | D | 11-Mar-2024 | 4.3 KiB | 116 | 56 |
| test_netif.cpp | D | 11-Mar-2024 | 7.8 KiB | 216 | 133 |
| test_network_data.cpp | D | 11-Mar-2024 | 37.8 KiB | 942 | 755 |
| test_network_name.cpp | D | 11-Mar-2024 | 5.1 KiB | 124 | 70 |
| test_platform.cpp | D | 11-Mar-2024 | 22.3 KiB | 742 | 520 |
| test_platform.h | D | 11-Mar-2024 | 2.4 KiB | 57 | 22 |
| test_pool.cpp | D | 11-Mar-2024 | 4.2 KiB | 141 | 82 |
| test_power_calibration.cpp | D | 11-Mar-2024 | 6.8 KiB | 152 | 100 |
| test_priority_queue.cpp | D | 11-Mar-2024 | 15.3 KiB | 380 | 264 |
| test_pskc.cpp | D | 11-Mar-2024 | 5.4 KiB | 118 | 78 |
| test_routing_manager.cpp | D | 11-Mar-2024 | 148.7 KiB | 3,945 | 2,342 |
| test_serial_number.cpp | D | 11-Mar-2024 | 9.3 KiB | 229 | 160 |
| test_smart_ptrs.cpp | D | 11-Mar-2024 | 12.2 KiB | 483 | 319 |
| test_spinel_buffer.cpp | D | 11-Mar-2024 | 44 KiB | 1,065 | 804 |
| test_spinel_decoder.cpp | D | 11-Mar-2024 | 24 KiB | 650 | 462 |
| test_spinel_encoder.cpp | D | 11-Mar-2024 | 14.2 KiB | 369 | 278 |
| test_srp_server.cpp | D | 11-Mar-2024 | 35.6 KiB | 1,051 | 596 |
| test_string.cpp | D | 11-Mar-2024 | 16.1 KiB | 426 | 309 |
| test_timer.cpp | D | 11-Mar-2024 | 28.1 KiB | 697 | 465 |
| test_tlv.cpp | D | 11-Mar-2024 | 7.1 KiB | 195 | 113 |
| test_toolchain.cpp | D | 11-Mar-2024 | 5.5 KiB | 184 | 121 |
| test_toolchain_c.c | D | 11-Mar-2024 | 2 KiB | 50 | 16 |
| test_trickle_timer.cpp | D | 11-Mar-2024 | 15.5 KiB | 517 | 296 |
| test_url.cpp | D | 11-Mar-2024 | 11.1 KiB | 282 | 218 |
| test_util.cpp | D | 11-Mar-2024 | 2.5 KiB | 72 | 33 |
| test_util.h | D | 11-Mar-2024 | 4.5 KiB | 88 | 34 |
| test_util.hpp | D | 11-Mar-2024 | 2.1 KiB | 47 | 6 |
README.md
1# OpenThread Unit Tests
2
3This page describes how to build and run OpenThread unit tests. It will be helpful for developers to debug failed unit test cases if they got one in CI or to add some new test cases.
4
5## Build Simulation
6
7The unit tests cannot be built solely without building the whole project. So first build OpenThread on the simulation platform, which will also build all unit tests:
8
9```
10# Go to the root directory of OpenThread
11$ script/cmake-build simulation
12```
13
14## List all tests
15
16To see what tests are available in OpenThread:
17
18```
19# Make sure you are at the simulation build directory (build/simulation)
20$ ctest -N
21```
22
23## Run the Unit Tests
24
25To run all the unit tests:
26
27```
28# Make sure you are at the simulation build directory (build/simulation)
29$ ctest
30```
31
32To run a specific unit test, for example, `ot-test-spinel`:
33
34```
35# Make sure you are at the simulation build directory (build/simulation)
36$ ctest -R ot-test-spinel
37```
38
39## Update a Test Case
40
41If you are developing a unit test case and have made some changes in the test source file, you will need rebuild the test before running it:
42
43```
44# Make sure you are at the simulation build directory (build/simulation)
45$ ninja <test_name>
46```
47
48This will only build the test and take a short time.
49
50If any changes or fixes were made to the OpenThread code, then you'll need to rebuild the entire project:
51
52```
53# Make sure you are at the simulation build directory (build/simulation)
54$ ninja
55```
56
57This will build the updated OpenThread code as well as the test cases.
58