Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
CMakeLists.txt | D | 11-Mar-2024 | 22.1 KiB | 1,190 | 927 | |
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 | 264 | 162 | |
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 | 17 KiB | 482 | 298 | |
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 | 363 | 277 | |
test_data.cpp | D | 11-Mar-2024 | 7.6 KiB | 213 | 145 | |
test_dns.cpp | D | 11-Mar-2024 | 60 KiB | 1,433 | 1,028 | |
test_dns_client.cpp | D | 11-Mar-2024 | 33.7 KiB | 903 | 606 | |
test_dso.cpp | D | 11-Mar-2024 | 50.5 KiB | 1,236 | 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 | 28.7 KiB | 656 | 447 | |
test_heap.cpp | D | 11-Mar-2024 | 5.4 KiB | 186 | 110 | |
test_heap_array.cpp | D | 11-Mar-2024 | 15.4 KiB | 495 | 346 | |
test_heap_string.cpp | D | 11-Mar-2024 | 10.6 KiB | 320 | 220 | |
test_hkdf_sha256.cpp | D | 11-Mar-2024 | 8.9 KiB | 168 | 104 | |
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 | 83 | |
test_ip6_header.cpp | D | 11-Mar-2024 | 5.7 KiB | 143 | 90 | |
test_ip_address.cpp | D | 11-Mar-2024 | 35.6 KiB | 892 | 679 | |
test_link_quality.cpp | D | 11-Mar-2024 | 18.1 KiB | 540 | 372 | |
test_linked_list.cpp | D | 11-Mar-2024 | 14.6 KiB | 437 | 315 | |
test_lowpan.cpp | D | 11-Mar-2024 | 78.9 KiB | 2,101 | 1,251 | |
test_lowpan.hpp | D | 11-Mar-2024 | 9.3 KiB | 291 | 105 | |
test_mac_frame.cpp | D | 11-Mar-2024 | 28.6 KiB | 736 | 512 | |
test_macros.cpp | D | 11-Mar-2024 | 4.9 KiB | 145 | 80 | |
test_meshcop.cpp | D | 11-Mar-2024 | 7 KiB | 165 | 105 | |
test_message.cpp | D | 11-Mar-2024 | 15.9 KiB | 410 | 265 | |
test_message_queue.cpp | D | 11-Mar-2024 | 12.8 KiB | 351 | 222 | |
test_mle.cpp | D | 11-Mar-2024 | 7.2 KiB | 186 | 121 | |
test_multicast_listeners_table.cpp | D | 11-Mar-2024 | 7.4 KiB | 201 | 120 | |
test_nat64.cpp | D | 11-Mar-2024 | 14.6 KiB | 315 | 216 | |
test_ndproxy_table.cpp | D | 11-Mar-2024 | 4.4 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 | 940 | 753 | |
test_network_name.cpp | D | 11-Mar-2024 | 5.1 KiB | 124 | 70 | |
test_platform.cpp | D | 11-Mar-2024 | 18.3 KiB | 627 | 432 | |
test_platform.h | D | 11-Mar-2024 | 2.2 KiB | 52 | 17 | |
test_pool.cpp | D | 11-Mar-2024 | 4.2 KiB | 137 | 80 | |
test_power_calibration.cpp | D | 11-Mar-2024 | 7 KiB | 152 | 100 | |
test_priority_queue.cpp | D | 11-Mar-2024 | 15.6 KiB | 378 | 264 | |
test_pskc.cpp | D | 11-Mar-2024 | 5.4 KiB | 118 | 78 | |
test_routing_manager.cpp | D | 11-Mar-2024 | 119.1 KiB | 3,154 | 1,769 | |
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 | 31 KiB | 920 | 519 | |
test_string.cpp | D | 11-Mar-2024 | 15.1 KiB | 395 | 288 | |
test_timer.cpp | D | 11-Mar-2024 | 27.8 KiB | 686 | 458 | |
test_tlv.cpp | D | 11-Mar-2024 | 7.1 KiB | 195 | 113 | |
test_toolchain.cpp | D | 11-Mar-2024 | 5.5 KiB | 180 | 119 | |
test_toolchain_c.c | D | 11-Mar-2024 | 2 KiB | 50 | 16 | |
test_util.cpp | D | 11-Mar-2024 | 2.5 KiB | 72 | 33 | |
test_util.h | D | 11-Mar-2024 | 4.6 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