From patchwork Thu Mar 4 13:50:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1447334 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=d6m9bget; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Drsnb4Y8rz9sSC for ; Fri, 5 Mar 2021 00:55:15 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9C10D82867; Thu, 4 Mar 2021 14:52: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=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="d6m9bget"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 790F0827E1; Thu, 4 Mar 2021 14:52:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) (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 2C964826A5 for ; Thu, 4 Mar 2021 14:52:00 +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-ot1-x333.google.com with SMTP id w3so7540777oti.8 for ; Thu, 04 Mar 2021 05:52:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=P43RCv2xSUQD5GJJb1x90FWsuT2JOZ85cy6WDv4Kgno=; b=d6m9bget4ChVrgeRchngJXTJGKo0bFXLPq/2KRKEZx41KWQelp3oeZY+QwPnrUaDiI fZxoOj+rhYM8RsQxYs1DWNIVycCAVs4U3KsjPuF7p/B85T4skU4MWcvZjcehVYGhb8Q8 FffXnmNTIW+3m17B/5IwJHU7PLXECD5r1uBoI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=P43RCv2xSUQD5GJJb1x90FWsuT2JOZ85cy6WDv4Kgno=; b=hq0092RBsh4oHiSIQDr3gYt29WbAjj5jDvkY9pq3XlwrcRL9ceHC0aZwyfduPQXc2+ sxBl5O02Bi7nT5TWTKtehhm/dkQzSygZs3AuuxXVupEGJDISgBMgfCK6G/k2kXMVvLnO +Pt9q9PMHAAmnctaR3nKqBC6Wh97lxiAmU6vcV8pUuMq3ALbZYlk3nj+ZvVmWVplxghZ jvQnVMbxYcc6ymucNVRJBPRjlRPKzynXGHFToaVNkEFAkNghnoCCkRxNkekJgt4bvhiW A3RFiIasfy4HIn7QKcZV4ZVrKcLzTNNEZkjc52UNJZIZLa5oHJ+q4RthFGCRBYOvy/xQ 20lg== X-Gm-Message-State: AOAM5303ABnKDsZ3n0BHpjGBmec7jBeY5jeRT6D0/pyTN3Uv8MMSmVhR LN4MR9xIByRm2PfzUZipIxaevxANgI76Pp5l X-Google-Smtp-Source: ABdhPJwEmZ7D+yq0lPEPnAJLGBBrurDOcyoAD8M5X6dgRn6Qydox2uu/F1mhy3r9HD8bGqKh+2YNdA== X-Received: by 2002:a05:6830:1416:: with SMTP id v22mr3430778otp.239.1614865916939; Thu, 04 Mar 2021 05:51:56 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id x10sm4029465otp.19.2021.03.04.05.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Mar 2021 05:51:56 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Stephen Warren , Stephen Warren , Simon Glass Subject: [PATCH v4 15/42] test: Move do_autoprobe() to test_pre_run() Date: Thu, 4 Mar 2021 06:50:51 -0700 Message-Id: <20210304135118.643277-15-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210304135118.643277-1-sjg@chromium.org> References: <20210304135118.643277-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean Move this step over to the pre-run function. Signed-off-by: Simon Glass --- (no changes since v1) test/dm/test-dm.c | 17 ----------------- test/test-main.c | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/test/dm/test-dm.c b/test/dm/test-dm.c index 4cb0da13b7c..c2e1a1b9207 100644 --- a/test/dm/test-dm.c +++ b/test/dm/test-dm.c @@ -43,21 +43,6 @@ static int dm_test_init(struct unit_test_state *uts, bool of_live) return 0; } -/* Ensure all the test devices are probed */ -static int do_autoprobe(struct unit_test_state *uts) -{ - struct udevice *dev; - int ret; - - /* Scanning the uclass is enough to probe all the devices */ - for (ret = uclass_first_device(UCLASS_TEST, &dev); - dev; - ret = uclass_next_device(&dev)) - ; - - return ret; -} - static int dm_test_destroy(struct unit_test_state *uts) { int id; @@ -91,8 +76,6 @@ static int dm_do_test(struct unit_test_state *uts, struct unit_test *test, uts->start = mallinfo(); if (test->flags & UT_TESTF_SCAN_PDATA) ut_assertok(dm_scan_plat(false)); - if (test->flags & UT_TESTF_PROBE_TEST) - ut_assertok(do_autoprobe(uts)); ut_assertok(test_pre_run(uts, test)); diff --git a/test/test-main.c b/test/test-main.c index a971fe0e9c8..bd2f08a2b42 100644 --- a/test/test-main.c +++ b/test/test-main.c @@ -13,12 +13,30 @@ DECLARE_GLOBAL_DATA_PTR; +/* Ensure all the test devices are probed */ +static int do_autoprobe(struct unit_test_state *uts) +{ + struct udevice *dev; + int ret; + + /* Scanning the uclass is enough to probe all the devices */ + for (ret = uclass_first_device(UCLASS_TEST, &dev); + dev; + ret = uclass_next_device(&dev)) + ; + + return ret; +} + int test_pre_run(struct unit_test_state *uts, struct unit_test *test) { /* DM tests have already done this */ if (!(test->flags & UT_TESTF_DM)) uts->start = mallinfo(); + if (test->flags & UT_TESTF_PROBE_TEST) + ut_assertok(do_autoprobe(uts)); + if (!CONFIG_IS_ENABLED(OF_PLATDATA) && (test->flags & UT_TESTF_SCAN_FDT)) ut_assertok(dm_extended_scan(false));