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 E7F22C433FE for ; Sun, 30 Oct 2022 01:50:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B81C685104; Sun, 30 Oct 2022 02:47:57 +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="MMsya5aI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1F4A385112; Sun, 30 Oct 2022 02:47:49 +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 83FA785123 for ; Sun, 30 Oct 2022 02:47:45 +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 l6so4778970ilq.3 for ; Sat, 29 Oct 2022 18:47:45 -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=WnakI8GVgeHuHpGeKceKu6c7rjjYEEp2bic0uaX6bpE=; b=MMsya5aIi7kKuWlYEXBnCCf8xZ9WduUJDiw3FeB1iyBQXNaw8rRfjqejtFtPz5sFzE SwnO7pQmTNOa1I5/kCGB55d26AqaF+rws2Vzl6OzOivBwRvKURBfuSSOSL+4gXGcmby9 Hon01C5Syd7NiRLmLrkZUQ+0HpKAEOsgoOQ7c= 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=WnakI8GVgeHuHpGeKceKu6c7rjjYEEp2bic0uaX6bpE=; b=0aTV5MYkOLGWxOdKqwra+Gm+Gg5TbVwUzQTC4smewLstZCLZe96xD2lRPPyuJTUTQ5 JBaNmPTqm5j/ptAcKkvyIZbpof0COkntRYwQkvhgWCCHAyjmldGkeW5HO0/8iSzJ8cdQ RZX6DQiJ1B3Ge3VuMSh0pWxPQ6zKNBoTO4+Z9HMspwn55J619yYUnKr1hybVNdx91pKE 1D6uzPzKVVgmIobpM9cUujVf9aKelNxVg1WFUZyvX9+2N/RmFiKsn5dCukiIr2fJ5egG 6enTu8KuXBKFCTPBfuIxaAcZ/Vy+b6LcIrCq/C4lQRtfN2QoNhx4vJEwbpuYyq0M3QOM v4EQ== X-Gm-Message-State: ACrzQf3UvVMsoCrIGonMheY1nMyb0PX0YGyDuu33IG4d3G/JQak/atg9 VdGVDPOehom9fiv2B7aYVDNpJMqXScp5tA== X-Google-Smtp-Source: AMsMyM5gLxkywHowVdKo7IamCTpd9Xl0vXKeqWv1l2ooPucmWY6hJIx/KkE9+CErZe3Qx7hycq2cJQ== X-Received: by 2002:a05:6e02:18ca:b0:300:3607:9474 with SMTP id s10-20020a056e0218ca00b0030036079474mr3137694ilu.54.1667094463998; Sat, 29 Oct 2022 18:47:43 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Oct 2022 18:47:43 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass , Marek Vasut , Pavel Herrmann Subject: [PATCH 05/17] dm: test: Drop the special function for running DM tests Date: Sat, 29 Oct 2022 19:47:07 -0600 Message-Id: <20221030014719.147327-6-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 This is not needed since the flag takes care of all differences. Make use of the common function. Signed-off-by: Simon Glass --- test/dm/test-dm.c | 49 ++++------------------------------------------- 1 file changed, 4 insertions(+), 45 deletions(-) diff --git a/test/dm/test-dm.c b/test/dm/test-dm.c index 66cc2bc6cce..e73a1dd8f81 100644 --- a/test/dm/test-dm.c +++ b/test/dm/test-dm.c @@ -4,55 +4,14 @@ */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include - -DECLARE_GLOBAL_DATA_PTR; -/** - * dm_test_run() - Run driver model tests - * - * Run all the available driver model tests, or a selection - * - * @test_name: Name of single test to run (e.g. "dm_test_fdt_pre_reloc" or just - * "fdt_pre_reloc"), or NULL to run all - * Return: 0 if all tests passed, 1 if not - */ -static int dm_test_run(const char *test_name, int runs_per_text) +int do_ut_dm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct unit_test *tests = UNIT_TEST_SUITE_START(dm_test); const int n_ents = UNIT_TEST_SUITE_COUNT(dm_test); - int ret; - - ret = ut_run_list("driver model", "dm_test_", tests, n_ents, test_name, - runs_per_text, false); - - return ret ? CMD_RET_FAILURE : 0; -} - -int do_ut_dm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - const char *test_name = NULL; - int runs_per_text = 1; - - if (argc > 1 && !strncmp("-r", argv[1], 2)) { - runs_per_text = dectoul(argv[1] + 2, NULL); - argv++; - argc++; - } - if (argc > 1) - test_name = argv[1]; - return dm_test_run(test_name, runs_per_text); + return cmd_ut_category("driver model", "dm_test_", tests, n_ents, argc, + argv); } -- 2.38.1.273.g43a17bfeac-goog