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 323BDC433FE for ; Sun, 30 Oct 2022 01:51:02 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 651A78516B; Sun, 30 Oct 2022 02:48:13 +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="iXDuaLOR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 16DA085167; Sun, 30 Oct 2022 02:47:53 +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 087E38515D for ; Sun, 30 Oct 2022 02:47:48 +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 l6so4779007ilq.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=d6Amwlxu4EPTlPioNKrSjnq9m+dDUwCEIZRmTkhxl+g=; b=iXDuaLORzdFtQCDZZPwrHALlqbaNZDaMTfyi673zyclSdAZFxWjRPLKXye2fAlT94h nUAXCyoI+8erHP+hF4D2VULh4Pw7USs7FYQtJBqfHeQ1WvqHPuDvBndNOf7+gv/0GdSc J+nitQbEvD1t3fNaAnyJWJuQLtDcXejgarMIY= 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=d6Amwlxu4EPTlPioNKrSjnq9m+dDUwCEIZRmTkhxl+g=; b=0ujLu3fvq49fIXM4u5CpIpaA0S4AWuQjk9zx2uaV1QMHeb6LfQ9fvL0cKc+A0CF0RX Rz0qNb+NoiNV9gW0mG5rukUZnitJzDsKVliFIe5iQWXbK5MUl9B/q1k3o2dHeNkR3Hbi cH8bb9zOrvMztp1j35XY4LxRxmzwhnQjzHOXGFRNs73E+3wf4KEyib1gc6m382YQAcYy J4YO8oTOU0P8BPT9sGWklmGrXkEHa9fC3NKyDxY6zt4+YNtEX64dMOPpIyWbvM/e7NL1 hmiJpAqdV0JEqhIstFCeXYyemQLlh5BcO/yEZbI8kVS/TobLd20NhJNh5tLdlPs+qpBh 0Ecg== X-Gm-Message-State: ACrzQf2mWb76Yy6ps9afYVM/V6b5NQI5dIKYFV+W7JUcs3ldrafxtzI6 Nqx+vmsOHXmad+SwlFQiAe4Q7jIuT521Zg== X-Google-Smtp-Source: AMsMyM7Sce/CAflZyr8yIsuCN8wpDoz9pQ3oUZKH8muXXiEnPugjBHL5JeiOIPsO/MoRiWrI6zhUjw== X-Received: by 2002:a05:6e02:1006:b0:2ff:945b:61c3 with SMTP id n6-20020a056e02100600b002ff945b61c3mr3115878ilj.119.1667094467481; Sat, 29 Oct 2022 18:47:47 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Oct 2022 18:47:47 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass , Rui Miguel Silva Subject: [PATCH 10/17] test: Allow showing basic information about tests Date: Sat, 29 Oct 2022 19:47:12 -0600 Message-Id: <20221030014719.147327-11-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 Add a 'ut info' command to show the number of suites and tests. This is useful to get a feel for the scale of the tests. Signed-off-by: Simon Glass --- doc/usage/cmd/ut.rst | 6 ++++++ test/cmd_ut.c | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/doc/usage/cmd/ut.rst b/doc/usage/cmd/ut.rst index 9f602ea7917..11c64a17793 100644 --- a/doc/usage/cmd/ut.rst +++ b/doc/usage/cmd/ut.rst @@ -100,3 +100,9 @@ Run just a single test in a suite:: => ut bloblist bloblist_test_grow Test: bloblist_test_grow: bloblist.c Failures: 0 + +Show information about tests:: + + => ut info + Test suites: 21 + Total tests: 642 diff --git a/test/cmd_ut.c b/test/cmd_ut.c index 81433cd36f4..b61ce79311c 100644 --- a/test/cmd_ut.c +++ b/test/cmd_ut.c @@ -14,6 +14,9 @@ static int do_ut_all(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); +static int do_ut_info(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]); + int cmd_ut_category(const char *name, const char *prefix, struct unit_test *tests, int n_ents, int argc, char *const argv[]) @@ -45,6 +48,7 @@ int cmd_ut_category(const char *name, const char *prefix, static struct cmd_tbl cmd_ut_sub[] = { U_BOOT_CMD_MKENT(all, CONFIG_SYS_MAXARGS, 1, do_ut_all, "", ""), + U_BOOT_CMD_MKENT(info, 1, 1, do_ut_info, "", ""), #ifdef CONFIG_BOOTSTD U_BOOT_CMD_MKENT(bootstd, CONFIG_SYS_MAXARGS, 1, do_ut_bootstd, "", ""), @@ -116,6 +120,15 @@ static int do_ut_all(struct cmd_tbl *cmdtp, int flag, int argc, return any_fail; } +static int do_ut_info(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + printf("Test suites: %d\n", (int)ARRAY_SIZE(cmd_ut_sub)); + printf("Total tests: %d\n", (int)UNIT_TEST_ALL_COUNT()); + + return 0; +} + static int do_ut(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct cmd_tbl *cp; @@ -142,8 +155,9 @@ static char ut_help_text[] = " -f Force 'manual' tests to run as well\n" " Test suite to run, or all\n" "\n" - "Suites:" + "\nOptions for :" "\nall - execute all enabled tests" + "\ninfo - show info about tests" #ifdef CONFIG_CMD_ADDRMAP "\naddrmap - very basic test of addrmap command" #endif -- 2.38.1.273.g43a17bfeac-goog