• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

CMakeLists.txtD11-Mar-202425.6 KiB1,3431,054

README.mdD11-Mar-20241.5 KiB5838

test_address_sanitizer.cppD11-Mar-20241.9 KiB4814

test_aes.cppD11-Mar-20249.8 KiB268164

test_array.cppD11-Mar-202412.7 KiB432291

test_binary_search.cppD11-Mar-20243.7 KiB10152

test_checksum.cppD11-Mar-202416.8 KiB483299

test_child.cppD11-Mar-202412 KiB353234

test_child_table.cppD11-Mar-202413.9 KiB404273

test_cmd_line_parser.cppD11-Mar-202416.3 KiB367279

test_data.cppD11-Mar-20247.6 KiB213145

test_dns.cppD11-Mar-202471.2 KiB1,6831,234

test_dns_client.cppD11-Mar-202441.7 KiB1,139755

test_dso.cppD11-Mar-202450.5 KiB1,238913

test_ecdsa.cppD11-Mar-20248.4 KiB198124

test_flash.cppD11-Mar-20245.8 KiB197119

test_frame_builder.cppD11-Mar-202410.1 KiB225158

test_hdlc.cppD11-Mar-202429.2 KiB659450

test_heap.cppD11-Mar-20245.5 KiB190112

test_heap_array.cppD11-Mar-202415.4 KiB495346

test_heap_string.cppD11-Mar-202411 KiB332229

test_hkdf_sha256.cppD11-Mar-20248.9 KiB172106

test_hmac_sha256.cppD11-Mar-202411.1 KiB294199

test_ip4_header.cppD11-Mar-20245.5 KiB13384

test_ip6_header.cppD11-Mar-20245.7 KiB14189

test_ip_address.cppD11-Mar-202435.2 KiB894679

test_link_metrics_manager.cppD11-Mar-20248.2 KiB223144

test_link_quality.cppD11-Mar-202418.4 KiB547377

test_linked_list.cppD11-Mar-202414.9 KiB447324

test_lowpan.cppD11-Mar-202478.8 KiB2,0991,250

test_lowpan.hppD11-Mar-20249.1 KiB291105

test_mac_frame.cppD11-Mar-202431.3 KiB784553

test_macros.cppD11-Mar-20244.9 KiB14982

test_meshcop.cppD11-Mar-20247 KiB165105

test_message.cppD11-Mar-202417.3 KiB437289

test_message_queue.cppD11-Mar-202412.7 KiB355224

test_mle.cppD11-Mar-20247.4 KiB187121

test_multicast_listeners_table.cppD11-Mar-20247.4 KiB201120

test_multipan_rcp_instances.cppD11-Mar-202423.5 KiB767550

test_nat64.cppD11-Mar-202414.6 KiB315216

test_ndproxy_table.cppD11-Mar-20244.3 KiB11656

test_netif.cppD11-Mar-20247.8 KiB216133

test_network_data.cppD11-Mar-202437.8 KiB942755

test_network_name.cppD11-Mar-20245.1 KiB12470

test_platform.cppD11-Mar-202422.3 KiB742520

test_platform.hD11-Mar-20242.4 KiB5722

test_pool.cppD11-Mar-20244.2 KiB14182

test_power_calibration.cppD11-Mar-20246.8 KiB152100

test_priority_queue.cppD11-Mar-202415.3 KiB380264

test_pskc.cppD11-Mar-20245.4 KiB11878

test_routing_manager.cppD11-Mar-2024148.7 KiB3,9452,342

test_serial_number.cppD11-Mar-20249.3 KiB229160

test_smart_ptrs.cppD11-Mar-202412.2 KiB483319

test_spinel_buffer.cppD11-Mar-202444 KiB1,065804

test_spinel_decoder.cppD11-Mar-202424 KiB650462

test_spinel_encoder.cppD11-Mar-202414.2 KiB369278

test_srp_server.cppD11-Mar-202435.6 KiB1,051596

test_string.cppD11-Mar-202416.1 KiB426309

test_timer.cppD11-Mar-202428.1 KiB697465

test_tlv.cppD11-Mar-20247.1 KiB195113

test_toolchain.cppD11-Mar-20245.5 KiB184121

test_toolchain_c.cD11-Mar-20242 KiB5016

test_trickle_timer.cppD11-Mar-202415.5 KiB517296

test_url.cppD11-Mar-202411.1 KiB282218

test_util.cppD11-Mar-20242.5 KiB7233

test_util.hD11-Mar-20244.5 KiB8834

test_util.hppD11-Mar-20242.1 KiB476

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