Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4BEF3C38A02 for ; Sun, 30 Oct 2022 01:50:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3B02485167; Sun, 30 Oct 2022 02:48:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="iocQfNK7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DED4B85118; Sun, 30 Oct 2022 02:47:51 +0100 (CET) Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5E88E85107 for ; Sun, 30 Oct 2022 02:47:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12e.google.com with SMTP id l6so4778997ilq.3 for ; Sat, 29 Oct 2022 18:47:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hFFwza7qvZhAFPUcPnUQKRnKgf+Q8DE5v+LrXzQSWCE=; b=iocQfNK7e16uMseQ3MywG4Aoqj0EEB/EQXE4qfkPPVfV2g0mPZfOuijxf5ApR2T9ML D5KfoeNLUGnMLvYtoCpz5Fe2/YsDLkOrBWOq0AbAs3aNFIW/Pczfm4JSHfPj6TlEgktO w/keX8LxUEEzQIZUia0omece+mCypNhb4C+OI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hFFwza7qvZhAFPUcPnUQKRnKgf+Q8DE5v+LrXzQSWCE=; b=N6dFqj6QEKfovVlocC62nlwr4ynJu280FhVIuCML6ys9ZEA+QiPyJo0ZVozYGh5abB vV28Gqt8Pea9cj1a07ay+ioon4xJmwprxOAyoyGT4slYpYJhESWbZ8WVfZ/UXvhMAFSk PDfHYVGP6O9TOVFaDExzG+4Kl+x7RoVWA2J9sAy0ikNbButGeJ8QHnxe+ggLuh3TXgxa 4uy3eb1SGCN+NoES0JEKIXRi+RiAsD+BIgAI/pg1PsJ9kp9AvgMLN6yD7qkqwM7cnj46 VAzH6FJBFjgFcbYuQI4q7jjfmo3bXcqTgcqC9+Qa6YSKMYieLlTvdGMPyf1wyf2eFPeK FPcA== X-Gm-Message-State: ACrzQf0JwNz1cAXzcLTreYDXOcyT5KR4z1yz7kmcPV/mOFaK2gG41Dsi oPMTnpXllHUdgeNYgMqWOFoBstGZw2FLnA== X-Google-Smtp-Source: AMsMyM6IU0Zh0LGcKFhn/uMKx7rlQyBby08jEwMWYmiuTdWx5QxsF7TY5tMAwbOxA8GYbbCXAaCO3w== X-Received: by 2002:a92:dc05:0:b0:300:9ad3:a7b0 with SMTP id t5-20020a92dc05000000b003009ad3a7b0mr1617863iln.33.1667094466801; Sat, 29 Oct 2022 18:47:46 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id x66-20020a0294c8000000b00363c4307bb2sm810287jah.79.2022.10.29.18.47.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Oct 2022 18:47:46 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass , Bin Meng , Ilias Apalodimas , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Roger Knecht Subject: [PATCH 09/17] test: doc: Add documentation for ut command Date: Sat, 29 Oct 2022 19:47:11 -0600 Message-Id: <20221030014719.147327-10-sjg@chromium.org> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <20221030014719.147327-1-sjg@chromium.org> References: <20221030014719.147327-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Before adding more options, document this command. Signed-off-by: Simon Glass --- doc/usage/cmd/ut.rst | 102 +++++++++++++++++++++++++++++++++++++++++++ doc/usage/index.rst | 1 + 2 files changed, 103 insertions(+) create mode 100644 doc/usage/cmd/ut.rst diff --git a/doc/usage/cmd/ut.rst b/doc/usage/cmd/ut.rst new file mode 100644 index 00000000000..9f602ea7917 --- /dev/null +++ b/doc/usage/cmd/ut.rst @@ -0,0 +1,102 @@ +.. SPDX-License-Identifier: GPL-2.0+: + +ut command +========== + +Synopis +------- + +:: + + ut [-r] [-f] [ []] + + Number of times to run each test + -f Force 'manual' tests to run as well + Test suite to run, or `all` + Name of single test to run + +Description +----------- + +The ut command runs unit tests written in C. + +Typically the command is run on :ref:`arch/sandbox/sandbox:sandbox` since it +includes a near-complete set of emulators, no code-size limits, many CONFIG +options enabled and runs easily in CI without needing QEMU. It is also possible +to run some tests on real boards. + +For a list of available test suites, type `ut` by itself. + +Each test is normally run once, although those marked with `UT_TESTF_DM` are +run with livetree and flattree where possible. To run a test more than once, +use the `-r` flag. + +Manual tests are normally skipped by this command. Use `-f` to run them. See +See :ref:`develop/tests_writing:mixing python and c` for more information on +manual test. + +Generally all tests in the suite are run. To run just a single test from the +suite, provide the argument. + +See :ref:`develop/tests_writing:writing c tests` for more information on how to +write unit tests. + +Example +------- + +List available unit-test suites:: + + => ut + ut - unit tests + + Usage: + ut [-r] [-f] [] - run unit tests + -r Number of times to run each test + -f Force 'manual' tests to run as well + Test suite to run, or all + + Suites: + all - execute all enabled tests + addrmap - very basic test of addrmap command + bloblist - bloblist implementation + bootstd - standard boot implementation + compression - compressors and bootm decompression + dm - driver model + env - environment + fdt - fdt command + loadm - loadm command parameters and loading memory blob + lib - library functions + log - logging functions + mem - memory-related commands + overlay - device tree overlays + print - printing things to the console + setexpr - setexpr command + str - basic test of string functions + time - very basic test of time functions + unicode - Unicode functions + +Run one of the suites:: + + => ut bloblist + Running 14 bloblist tests + Test: bloblist_test_align: bloblist.c + Test: bloblist_test_bad_blob: bloblist.c + Test: bloblist_test_blob: bloblist.c + Test: bloblist_test_blob_ensure: bloblist.c + Test: bloblist_test_blob_maxsize: bloblist.c + Test: bloblist_test_checksum: bloblist.c + Test: bloblist_test_cmd_info: bloblist.c + Test: bloblist_test_cmd_list: bloblist.c + Test: bloblist_test_grow: bloblist.c + Test: bloblist_test_init: bloblist.c + Test: bloblist_test_reloc: bloblist.c + Test: bloblist_test_resize_fail: bloblist.c + Test: bloblist_test_resize_last: bloblist.c + Test: bloblist_test_shrink: bloblist.c + Failures: 0 + +Run just a single test in a suite:: + + => ut bloblist bloblist_test_grow + Test: bloblist_test_grow: bloblist.c + Failures: 0 diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 90221015ee1..fa847ddf492 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -72,6 +72,7 @@ Shell commands cmd/tftpput cmd/true cmd/ums + cmd/ut cmd/wdt cmd/xxd -- 2.38.1.273.g43a17bfeac-goog