From patchwork Sat Oct 3 15:25:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1376288 X-Patchwork-Delegate: sjg@chromium.org 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; dmarc=pass (p=none dis=none) header.from=chromium.org 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=k5ZI1YVx; 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 4C3W3156RVz9s1t for ; Sun, 4 Oct 2020 01:28:13 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 60E21823BE; Sat, 3 Oct 2020 17:26:15 +0200 (CEST) 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="k5ZI1YVx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A24188237B; Sat, 3 Oct 2020 17:26:07 +0200 (CEST) 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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (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 B90FC8236D for ; Sat, 3 Oct 2020 17:26:04 +0200 (CEST) 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-io1-xd44.google.com with SMTP id d197so4699433iof.0 for ; Sat, 03 Oct 2020 08:26:04 -0700 (PDT) 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=plvqHOC8ZSsDcgIcQ5VNAYTyOtWeYJu5PgyuSefWy8A=; b=k5ZI1YVxuuqafjrs5cEacURIZEy+IJOvme4MsZ3h3NgiOWAv8wUO64ZG7o2nrZdTcQ sGzGlBS3xZtuRg1qh7TmyY+Xft3TNOjtcJ8u0UriJZ2+xTY6vT2wo9NzL7sslxW3kE0D iPb7fL+HzOH5bchliR1L2W1shMvXLqftHMWdA= 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=plvqHOC8ZSsDcgIcQ5VNAYTyOtWeYJu5PgyuSefWy8A=; b=B9Z2dN3exhlhMnso3vTJEcj0sdyCilzKIa0zbJo3doSSnChrVxgZf3HKXS7ncQZZ1L ZO2yjkh71qkEaOwCSYn8JtZvja9bGzMFd+aNCQ7qqFaDBk4C51bebTB5o7WACoRQhso+ wPh7SyH4Ru6CLhAR5DtZSLhejFdpDCvhVk9FXC5KbQrU4xCujBY8csA+1d//rZs9Ca7K zmlCkh3SucN8iPGP/5dQTLVqaR9nlfYJWlifVbkY1kDDFU8BP2wz/ML1fapgZN//fQEh xjIFaonzWyuPdfIFrt5YozsHiFYQdhBi5fuZXeQgN9pHGABJbUWeV74xQJ1hCPcA4kcG 29sw== X-Gm-Message-State: AOAM532WMvQNGYfj2T7VYYCiJaDGCoozn9/i0LZDW0stZylgq3ZyD9L0 jJH3vUePqkTD2fNAPLqv//drZj0v7sUMT2QJ X-Google-Smtp-Source: ABdhPJxGENXY0XtZrpQPepT/h4i8zg1AC6vahBops8bCWAMeDwdvpli2LVC8t1ooIZ7BoNLz8mXy+w== X-Received: by 2002:a5d:914a:: with SMTP id y10mr5751899ioq.108.1601738763492; Sat, 03 Oct 2020 08:26:03 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id l77sm2099558ill.4.2020.10.03.08.26.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Oct 2020 08:26:03 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , AKASHI Takahiro , Heiko Stuebner , Heinrich Schuchardt , Jan Kiszka , Kever Yang , Marek Vasut , Masahiro Yamada , Pavel Herrmann , Vignesh Raghavendra Subject: [PATCH 10/17] dm: test: Build tests for SPL Date: Sat, 3 Oct 2020 09:25:27 -0600 Message-Id: <20201003152534.3184504-11-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.806.g8561365e88-goog In-Reply-To: <20201003152534.3184504-1-sjg@chromium.org> References: <20201003152534.3184504-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.3 at phobos.denx.de X-Virus-Status: Clean We want to run unit tests in SPL. Add a new Kconfig to control this and enable it for sandbox_spl Signed-off-by: Simon Glass --- configs/sandbox_spl_defconfig | 2 +- scripts/Makefile.spl | 1 + test/Kconfig | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/configs/sandbox_spl_defconfig b/configs/sandbox_spl_defconfig index 6d8e827aebc..49060cab7a3 100644 --- a/configs/sandbox_spl_defconfig +++ b/configs/sandbox_spl_defconfig @@ -22,7 +22,6 @@ CONFIG_BOOTSTAGE_STASH=y CONFIG_BOOTSTAGE_STASH_SIZE=0x4096 CONFIG_CONSOLE_RECORD=y CONFIG_CONSOLE_RECORD_OUT_SIZE=0x1000 -CONFIG_SILENT_CONSOLE=y CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_HANDOFF=y CONFIG_SPL_BOARD_INIT=y @@ -220,5 +219,6 @@ CONFIG_TPM=y CONFIG_LZ4=y CONFIG_ERRNO_STR=y CONFIG_UNIT_TEST=y +CONFIG_SPL_UNIT_TEST=y CONFIG_UT_TIME=y CONFIG_UT_DM=y diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index d528c994ff2..2e3a443035c 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -99,6 +99,7 @@ libs-y += dts/ libs-y += fs/ libs-$(CONFIG_SPL_POST_MEM_SUPPORT) += post/drivers/ libs-$(CONFIG_SPL_NET_SUPPORT) += net/ +libs-$(CONFIG_SPL_UNIT_TEST) += test/ head-y := $(addprefix $(obj)/,$(head-y)) libs-y := $(addprefix $(obj)/,$(libs-y)) diff --git a/test/Kconfig b/test/Kconfig index 28704a25b61..2646e7d825a 100644 --- a/test/Kconfig +++ b/test/Kconfig @@ -6,6 +6,16 @@ menuconfig UNIT_TEST This does not require sandbox to be included, but it is most often used there. +config SPL_UNIT_TEST + bool "Unit tests in SPL" + # We need to be able to unbind devices for tests to work + select SPL_DM_DEVICE_REMOVE + help + Select this to enable unit tests in SPL. Most test are designed for + running in U-Boot proper, but some are intended for SPL, such as + of-platdata and SPL handover. To run these tests with the sandbox_spl + board, use the -u (unit test) option. + config UT_LIB bool "Unit tests for library functions" depends on UNIT_TEST