From patchwork Wed Dec 7 08:50:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1713113 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.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=URmc222i; 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NRrpC6jXJz23yq for ; Wed, 7 Dec 2022 20:00:03 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4CE618560E; Wed, 7 Dec 2022 09:55:51 +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="URmc222i"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EFA4085582; Wed, 7 Dec 2022 09:55:28 +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.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (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 C00DF855F2 for ; Wed, 7 Dec 2022 09:55:25 +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-pl1-x62d.google.com with SMTP id s7so16415626plk.5 for ; Wed, 07 Dec 2022 00:55:25 -0800 (PST) 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=aBn+oUSMHkXMtvS1/XPEd67rm0BY+bOFGuogyJy4u/U=; b=URmc222izHe2uQW3kYV1qwjv/hbzfA8ANW1hUb7vNockp0jB9M4wsUonJrk6q2GytT bPRRZwBdxr+Q7oP9W+ErMOA6gYOs8p5tZ5mYu5X2TmZLMvM6MqNbuPmGhiDYECgKBKEi x4w+ZVqlQje+zi+OwkP+NCuNJslTsIrSAzADw= 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=aBn+oUSMHkXMtvS1/XPEd67rm0BY+bOFGuogyJy4u/U=; b=qQV7q7o8wAaFaTRrIbU0yr+Imz6SeoH1a/EBWIw1QLAfsxOkUy/Qxa3sVuzc21KsqU c/Kngphr4fxamDwfG4+hxsbjLKXolegrvw8tNy/hED+bLltq78G4tZQ655qPS2ILr+kX NPfTfBmYr+qaTh3DkQ4HlzgIBtZJJMbZvsxmGDGsrvsZngs2AUp7/G2EIvVStjeVKqq6 OYGvV/kAQgnjqqEAFUOfcu5aCPt1vlTYxOygQekQEGESz8Z9IUQf8AKApNFehusfPP2o o861Cvl1GiZuY+WqqqMfb7qq3OOq7jAUvRk974k9FmXHzNs9RI8NciYOhKcwvNFiPRxv cl+w== X-Gm-Message-State: ANoB5plgfLPdXpof4C4o5XWUzoqxRNOmf7+btg+hcBHQtGno9yRlO1U3 Og4LZiYYns0raC+QvfrY6A2ETqHi+WjBQK4n X-Google-Smtp-Source: AA0mqf7D6rC0WcU1KHJNx3PkY6DbM+LWbX8zy+sCeSHGbrWnELul0qNRsi0C9M5ugXMKKAxigpNPdg== X-Received: by 2002:a17:902:e394:b0:189:6b31:dc48 with SMTP id g20-20020a170902e39400b001896b31dc48mr56361952ple.67.1670403325117; Wed, 07 Dec 2022 00:55:25 -0800 (PST) Received: from localhost.localdomain ([27.110.126.54]) by smtp.gmail.com with ESMTPSA id l16-20020a170903121000b0018157b415dbsm14145514plh.63.2022.12.07.00.55.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 00:55:24 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: U-Boot Custodians , Simon Glass , Heinrich Schuchardt Subject: [PATCH 27/71] test: Add a generic function to skip delays Date: Wed, 7 Dec 2022 21:50:53 +1300 Message-Id: <20221207085137.445249-28-sjg@chromium.org> X-Mailer: git-send-email 2.39.0.rc0.267.gcb52ba06e7-goog In-Reply-To: <20221207085137.445249-1-sjg@chromium.org> References: <20221207085137.445249-1-sjg@chromium.org> MIME-Version: 1.0 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 At present this feature is sandbox-specific. For running tests on boards, we need a nop version. Add one. Signed-off-by: Simon Glass --- include/test/test.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/test/test.h b/include/test/test.h index beabe9333dc..752897cf06f 100644 --- a/include/test/test.h +++ b/include/test/test.h @@ -170,6 +170,22 @@ static inline int test_load_other_fdt(struct unit_test_state *uts) return ret; } +/** + * Control skipping of time delays + * + * Some tests have unnecessay time delays (e.g. USB). Allow these to be + * skipped to speed up testing + * + * @param skip_delays true to skip delays from now on, false to honour delay + * requests + */ +static inline void test_set_skip_delays(bool skip_delays) +{ +#ifdef CONFIG_SANDBOX + state_set_skip_delays(skip_delays); +#endif +} + /** * test_set_eth_enable() - Enable / disable Ethernet *