"Das U-Boot" Source Tree
at master 122 lines 4.1 kB view raw
1.. SPDX-License-Identifier: GPL-2.0+: 2 3.. index:: 4 single: ut (command) 5 6ut command 7========== 8 9Synopsis 10-------- 11 12:: 13 14 ut [-r<runs>] [-fs] [-I<n>:<one_test>] [<suite> [<test>]] 15 16 <runs> Number of times to run each test 17 -f Force 'manual' tests to run as well 18 <n> Run <one test> after <n> other tests have run 19 <one_test> Name of the 'one' test to run 20 <suite> Test suite to run, or `all` 21 <test> Name of single test to run 22 23Description 24----------- 25 26The ut command runs unit tests written in C. 27 28Typically the command is run on :ref:`arch/sandbox/sandbox:sandbox` since it 29includes a near-complete set of emulators, no code-size limits, many CONFIG 30options enabled and runs easily in CI without needing QEMU. It is also possible 31to run some tests on real boards. 32 33For a list of available test suites, type `ut info -s`. 34 35Each test is normally run once, although those marked with `UTF_DM` are 36run with livetree and flattree where possible. To run a test more than once, 37use the `-r` flag. 38 39Manual tests are normally skipped by this command. Use `-f` to run them. See 40See :ref:`develop/tests_writing:mixing python and c` for more information on 41manual test. 42 43When running unit tests, some may have side effects which cause a subsequent 44test to break. This can sometimes be seen when using 'ut dm' or similar. To 45fix this, select the 'one' test which breaks. Then tell the 'ut' command to 46run this one test after a certain number of other tests have run. Using a 47binary search method with `-I` you can quickly figure one which test is causing 48the problem. 49 50Generally all tests in the suite are run. To run just a single test from the 51suite, provide the <test> argument. 52 53See :ref:`develop/tests_writing:writing c tests` for more information on how to 54write unit tests. 55 56Example 57------- 58 59Show information about tests:: 60 61 => ut info 62 Test suites: 23 63 Total tests: 833 64 65List available unit-test suites:: 66 67 => ut info -s 68 Test suites: 23 69 Total tests: 833 70 71 Tests Suite Purpose 72 ----- ------------ ------------------------- 73 1 addrmap very basic test of addrmap command 74 4 bdinfo bdinfo (board info) command 75 14 bloblist bloblist implementation 76 7 bootm bootm command 77 66 bootstd standard boot implementation 78 2 cmd various commands 79 14 common tests for common/ directory 80 502 dm driver model 81 6 env environment 82 1 exit shell exit and variables 83 19 fdt fdt command 84 10 fdt_overlay device tree overlays 85 1 font font command 86 20 hush hush behaviour 87 115 lib library functions 88 2 loadm loadm command parameters and loading memory blob 89 18 log logging functions 90 1 mbr mbr command 91 1 measurement TPM-based measured boot 92 13 mem memory-related commands 93 1 pci_mps PCI Express Maximum Payload Size 94 11 setexpr setexpr command 95 4 upl Universal payload support 96 97 98Run one of the suites:: 99 100 => ut bloblist 101 Running 14 bloblist tests 102 Test: bloblist_test_align: bloblist.c 103 Test: bloblist_test_bad_blob: bloblist.c 104 Test: bloblist_test_blob: bloblist.c 105 Test: bloblist_test_blob_ensure: bloblist.c 106 Test: bloblist_test_blob_maxsize: bloblist.c 107 Test: bloblist_test_checksum: bloblist.c 108 Test: bloblist_test_cmd_info: bloblist.c 109 Test: bloblist_test_cmd_list: bloblist.c 110 Test: bloblist_test_grow: bloblist.c 111 Test: bloblist_test_init: bloblist.c 112 Test: bloblist_test_reloc: bloblist.c 113 Test: bloblist_test_resize_fail: bloblist.c 114 Test: bloblist_test_resize_last: bloblist.c 115 Test: bloblist_test_shrink: bloblist.c 116 Failures: 0 117 118Run just a single test in a suite:: 119 120 => ut bloblist bloblist_test_grow 121 Test: bloblist_test_grow: bloblist.c 122 Failures: 0