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

..--

CMakeLists.txtD03-Aug-20247.2 KiB264230

README.mdD03-Aug-20241.5 KiB5838

test_address_sanitizer.cppD03-Aug-20241.9 KiB4814

test_aes.cppD03-Aug-20249.8 KiB268164

test_array.cppD03-Aug-202412.7 KiB432291

test_binary_search.cppD03-Aug-20243.7 KiB10152

test_checksum.cppD03-Aug-202418.5 KiB545343

test_child.cppD03-Aug-202412 KiB353234

test_child_table.cppD03-Aug-202413.9 KiB404273

test_cmd_line_parser.cppD03-Aug-202416.3 KiB367279

test_data.cppD03-Aug-20247.6 KiB213145

test_dataset.cppD03-Aug-202410.4 KiB274166

test_dns.cppD03-Aug-202474.2 KiB1,7601,292

test_dns_client.cppD03-Aug-202441.7 KiB1,139755

test_dso.cppD03-Aug-202450.5 KiB1,238913

test_ecdsa.cppD03-Aug-20248.4 KiB198124

test_flash.cppD03-Aug-20245.8 KiB197119

test_frame_builder.cppD03-Aug-202410.1 KiB225158

test_hdlc.cppD03-Aug-202429.2 KiB659450

test_heap.cppD03-Aug-20245.5 KiB190112

test_heap_array.cppD03-Aug-202415.4 KiB495346

test_heap_string.cppD03-Aug-202411 KiB332229

test_hkdf_sha256.cppD03-Aug-20248.9 KiB172106

test_hmac_sha256.cppD03-Aug-202411.1 KiB294199

test_ip4_header.cppD03-Aug-20245.5 KiB13384

test_ip6_header.cppD03-Aug-20245.7 KiB14189

test_ip_address.cppD03-Aug-202436.6 KiB933708

test_link_metrics_manager.cppD03-Aug-20248.2 KiB223144

test_link_quality.cppD03-Aug-202418.4 KiB547377

test_linked_list.cppD03-Aug-202416 KiB484355

test_lowpan.cppD03-Aug-202478.8 KiB2,0991,250

test_lowpan.hppD03-Aug-20249.1 KiB291105

test_mac_frame.cppD03-Aug-202431.3 KiB784553

test_macros.cppD03-Aug-20244.9 KiB14982

test_mdns.cppD03-Aug-2024238.6 KiB6,9154,982

test_meshcop.cppD03-Aug-20248.4 KiB211144

test_message.cppD03-Aug-202417.3 KiB437289

test_message_queue.cppD03-Aug-202412.7 KiB355224

test_mle.cppD03-Aug-20247.4 KiB187121

test_multicast_listeners_table.cppD03-Aug-20247.4 KiB201120

test_multipan_rcp_instances.cppD03-Aug-202423.5 KiB767550

test_nat64.cppD03-Aug-202414.6 KiB315216

test_ndproxy_table.cppD03-Aug-20244.3 KiB11656

test_netif.cppD03-Aug-20247.8 KiB216133

test_network_data.cppD03-Aug-202438.6 KiB970769

test_network_name.cppD03-Aug-20245.1 KiB12470

test_platform.cppD03-Aug-202427.2 KiB887640

test_platform.hD03-Aug-20242.5 KiB5924

test_pool.cppD03-Aug-20244.2 KiB14182

test_power_calibration.cppD03-Aug-20246.8 KiB152100

test_priority_queue.cppD03-Aug-202415.3 KiB380264

test_pskc.cppD03-Aug-20245.1 KiB12877

test_routing_manager.cppD03-Aug-2024159.5 KiB4,2202,483

test_serial_number.cppD03-Aug-20249.3 KiB229160

test_smart_ptrs.cppD03-Aug-202412.2 KiB483319

test_spinel_buffer.cppD03-Aug-202444 KiB1,065804

test_spinel_decoder.cppD03-Aug-202424 KiB650462

test_spinel_encoder.cppD03-Aug-202414.2 KiB369278

test_srp_adv_proxy.cppD03-Aug-202496.1 KiB2,7861,794

test_srp_server.cppD03-Aug-202435.6 KiB1,051596

test_string.cppD03-Aug-202417.7 KiB486358

test_tcat.cppD03-Aug-20249.7 KiB206136

test_timer.cppD03-Aug-202428.1 KiB697465

test_tlv.cppD03-Aug-20247.1 KiB195113

test_toolchain.cppD03-Aug-20245.5 KiB184121

test_toolchain_c.cD03-Aug-20242 KiB5016

test_trickle_timer.cppD03-Aug-202415.5 KiB517296

test_url.cppD03-Aug-202411.1 KiB282218

test_util.cppD03-Aug-20242.5 KiB7233

test_util.hD03-Aug-20244.5 KiB8834

test_util.hppD03-Aug-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