From patchwork Mon Oct 26 02:38:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1387432 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=85.214.62.61; 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=fAfmjpQi; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4CKJv10YT4z9sSs for ; Mon, 26 Oct 2020 13:39:07 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F2C448249B; Mon, 26 Oct 2020 03:38:53 +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="fAfmjpQi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3E6B382465; Mon, 26 Oct 2020 03:38:50 +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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (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 AE4218245F for ; Mon, 26 Oct 2020 03:38:47 +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-io1-xd43.google.com with SMTP id r9so8491648ioo.7 for ; Sun, 25 Oct 2020 19:38:47 -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=eR9It4+wMG0fkzrMCwO7x/0vv+en01Bh2KSjZSTZMnc=; b=fAfmjpQifIlqtfZ1tynOh93p7dz9kK8PPJwysFxKhAOqLuaD9pGneuubzKanG4wZY+ yaTbEtrHEyInU/21lPab9cFYUbTFHXCqwaymqZ59pb2/2gE/3U5HyLOMAeX6nqYadT4u J5JrZo770z6LCOWkt0UT5KJhxJyao9x6R9OY4= 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=eR9It4+wMG0fkzrMCwO7x/0vv+en01Bh2KSjZSTZMnc=; b=iyPFHeI+0O8W8grpIH/4BVIypBzFtWhfuqd9QOoke2f2hovD+ewi3KrsF9wKK7zhsg Ehv+DRm+/GZramVlJW+9MY9yNfBvbkXRooQp1boPCvkXkRf/r3RQ/D0wwE1uYgP9224I IwnX9IZOFEOP7tbXYHz7PVX6hqZ44lFW49XMQfJba+UJSLIUEc1yXlb1G6E0fBXQvxkr q6xB6YfvNKD+kkkWLI+jcYQz89TnCj3DGZB5yTDgTdq92D9N2Ep9airP1UzEkfJjOFqM fIvDcdviJt/PsHK9LACaej/cn/3A5tmQ4D0FQtgJjIzWes6LFNKgEUVokbmlx631LZYj /n9A== X-Gm-Message-State: AOAM532P3UH2qEEq+GVSTuFTYgQts3n5vwT4FJ+8m1YL2aN7sd4B7VDZ eXTKFrlc6t6wTeQVKPp21WXwdw96I8c08zAu X-Google-Smtp-Source: ABdhPJy8CPTnBeitxRL9hxEDL5rfSTzUbKgjQOZGDoDwBunJMObKnvyOnqlO8iTwdqZrLV4BKB19Cg== X-Received: by 2002:a5d:9513:: with SMTP id d19mr9151170iom.29.1603679926352; Sun, 25 Oct 2020 19:38:46 -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 y3sm4632838ioq.18.2020.10.25.19.38.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 19:38:45 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Stephen Warren , Stephen Warren , Simon Glass , AKASHI Takahiro , Heiko Stuebner , Heinrich Schuchardt , Jan Kiszka , Jean-Jacques Hiblot , Marek Vasut , Masahiro Yamada , Pavel Herrmann , Vignesh Raghavendra Subject: [PATCH v2 01/11] dm: test: Build tests for SPL Date: Sun, 25 Oct 2020 20:38:26 -0600 Message-Id: <20201026023836.1629465-2-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc2.309.g374f81d7ae-goog In-Reply-To: <20201026023836.1629465-1-sjg@chromium.org> References: <20201026023836.1629465-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 --- (no changes since v1) 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 1d49e816393..f59e4f2e68c 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 @@ -221,5 +220,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 From patchwork Mon Oct 26 02:38: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: 1387434 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=85.214.62.61; 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=oFolb3/K; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4CKJvC55D4z9sSn for ; Mon, 26 Oct 2020 13:39:19 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 08D49824B5; Mon, 26 Oct 2020 03:38:55 +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="oFolb3/K"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F144082490; Mon, 26 Oct 2020 03:38:52 +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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (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 6133E8244A for ; Mon, 26 Oct 2020 03:38:50 +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-io1-xd43.google.com with SMTP id b15so8487358iod.13 for ; Sun, 25 Oct 2020 19:38:50 -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=kY3+ZjK9PxpUqG7VBCoju8zX6fjwFS+OWjt2E3pmUqg=; b=oFolb3/Kzz9JsViDdopBti2tp1AQO41JHkO4QhqYFm+DqW0J9KExLhme2Njh5VWDi2 hVEQbDX0Bxd3d2RWL2qM7okzTfPIVVVNR7Ido2AsrriWwJheNnzWE1hiktJinnnaahu0 sIOR+80IBn6bwGhDqx5hRmkb8eD9FEbfUX3QY= 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=kY3+ZjK9PxpUqG7VBCoju8zX6fjwFS+OWjt2E3pmUqg=; b=P8rFypugP46jdWoEAXmxY8r085JRgomep62B1XkthYL3HvkRpvq3SjRJ92A8/oqg+W ZJN1CWpjbFVRo6aIP7yxBBjrzV5M/NmteuxKAwmOh2ueo1kN6n4ZFHyGQNIWBrxz0Wkj Xoy2aMwZf/9Xm8MjWGXLIfilL5zx3W98FDl1yPba4eB2IWqgCazw7ctqzFYGXXFI2R+g 72r2iME88TZZFtFt5u0O+0lLD0ElxTSTtcsi2tp2XpmnWpRmwEFlIq1Vs15hgKs2Ggcv 7VBCNPHWRROfhvS4xEi6LcHtbwmBxexGAQLecT65avP3AIhbskcm5GsiFH5Ol3aR7S1N wPLg== X-Gm-Message-State: AOAM530LswfWxiORYgcJSEDrtEnTNdm/j2k8Y03YLNNsNPNmO0qUmfwL 0CEMY8L9icooS9/pRVnTziLOcYtIIVGt5Y2N X-Google-Smtp-Source: ABdhPJzGwz9Dh3DjCXdmA4brNoUcC7W9AZ1cBIgm63KkgW0OntSSdYOZDjeSabUGktZJAEnpAojsig== X-Received: by 2002:a02:c8d8:: with SMTP id q24mr5211195jao.66.1603679929079; Sun, 25 Oct 2020 19:38:49 -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 y3sm4632838ioq.18.2020.10.25.19.38.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 19:38:48 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Stephen Warren , Stephen Warren , Simon Glass , Marek Vasut , Pavel Herrmann Subject: [PATCH v2 02/11] dm: test: Update the test runner to support of-platdata Date: Sun, 25 Oct 2020 20:38:27 -0600 Message-Id: <20201026023836.1629465-3-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc2.309.g374f81d7ae-goog In-Reply-To: <20201026023836.1629465-1-sjg@chromium.org> References: <20201026023836.1629465-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 At present DM tests assume that a devicetree is available. This is not the case with of-platadata. Update the code to add this condition. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- (no changes since v1) test/dm/test-main.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/test/dm/test-main.c b/test/dm/test-main.c index 995988723ae..5560572c7c6 100644 --- a/test/dm/test-main.c +++ b/test/dm/test-main.c @@ -30,7 +30,8 @@ static int dm_test_init(struct unit_test_state *uts, bool of_live) memset(dms, '\0', sizeof(*dms)); gd->dm_root = NULL; - memset(dm_testdrv_op_count, '\0', sizeof(dm_testdrv_op_count)); + if (!CONFIG_IS_ENABLED(OF_PLATDATA)) + memset(dm_testdrv_op_count, '\0', sizeof(dm_testdrv_op_count)); state_reset_for_test(state_get_current()); /* Determine whether to make the live tree available */ @@ -91,7 +92,8 @@ static int dm_do_test(struct unit_test_state *uts, struct unit_test *test, ut_assertok(dm_scan_platdata(false)); if (test->flags & UT_TESTF_PROBE_TEST) ut_assertok(do_autoprobe(uts)); - if (test->flags & UT_TESTF_SCAN_FDT) + if (!CONFIG_IS_ENABLED(OF_PLATDATA) && + (test->flags & UT_TESTF_SCAN_FDT)) ut_assertok(dm_extended_scan_fdt(gd->fdt_blob, false)); /* @@ -136,14 +138,16 @@ static int dm_test_main(const char *test_name) uts->priv = &_global_priv_dm_test_state; uts->fail_count = 0; - /* - * If we have no device tree, or it only has a root node, then these - * tests clearly aren't going to work... - */ - if (!gd->fdt_blob || fdt_next_node(gd->fdt_blob, 0, NULL) < 0) { - puts("Please run with test device tree:\n" - " ./u-boot -d arch/sandbox/dts/test.dtb\n"); - ut_assert(gd->fdt_blob); + if (!CONFIG_IS_ENABLED(OF_PLATDATA)) { + /* + * If we have no device tree, or it only has a root node, then + * these * tests clearly aren't going to work... + */ + if (!gd->fdt_blob || fdt_next_node(gd->fdt_blob, 0, NULL) < 0) { + puts("Please run with test device tree:\n" + " ./u-boot -d arch/sandbox/dts/test.dtb\n"); + ut_assert(gd->fdt_blob); + } } if (!test_name) @@ -192,7 +196,8 @@ static int dm_test_main(const char *test_name) gd->dm_root = NULL; ut_assertok(dm_init(CONFIG_IS_ENABLED(OF_LIVE))); dm_scan_platdata(false); - dm_scan_fdt(gd->fdt_blob, false); + if (!CONFIG_IS_ENABLED(OF_PLATDATA)) + dm_scan_fdt(gd->fdt_blob, false); return uts->fail_count ? CMD_RET_FAILURE : 0; } From patchwork Mon Oct 26 02:38:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1387435 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=K+12WDJu; 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) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CKJvc5Cjpz9sSn for ; Mon, 26 Oct 2020 13:39:40 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5B7B18249C; Mon, 26 Oct 2020 03:38:59 +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="K+12WDJu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 194C48249C; Mon, 26 Oct 2020 03:38:54 +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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (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 5236B82485 for ; Mon, 26 Oct 2020 03:38: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=sjg@chromium.org Received: by mail-il1-x142.google.com with SMTP id x20so1530374ilj.8 for ; Sun, 25 Oct 2020 19:38:51 -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=7L7qUuTcZu/3fxVZGiMC3iy1i/9GPSkTAO5H3zhbDVY=; b=K+12WDJubyjIWtGauFOvUGpzpmvYzZuDx1bFju+SVGnZVOAttu0+L1gAR5fmzvewhK IbAxoY+OakTE4SrUw/C85C/dBswpHigUot5DU/avgdbrnLd9tR/pHJ2uRTYzdxlUcTQ0 NLHL5OkVwANbuEDiVTGL8PvgkGaxVe/VBosx8= 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=7L7qUuTcZu/3fxVZGiMC3iy1i/9GPSkTAO5H3zhbDVY=; b=WluYT5Ja0StXc+1Q48ToVHAAtN+nMQPBVWWfBDSUCYR8N5cB6lmOeGgNBvN6nvvhxc fhwhjaEtxn9+MWSmTQlvfWg/ZHWS/gHEOBbmpMQ4qfv/Tta1lxHcd7hPEVGc5Pi08BgP +k9YfUZTrWRhD+2iqXbX3byQceJ2u4LAJnnnTrWF9kP4sMwobBOpck0ICwvhI9YOZJnw jdV3NFH5JFh8GiZaZlm/DCbMLTY7KbwBYoJRQvx7SuslK9FRYzstd4rph2hPoR00BtGH hSTPscYAOM/XQmMI1hlTqqZGmqmUvivL61EyFm3i5d/5ZCwR8ctm+bS1Xv51rsEiHcJT ZqGw== X-Gm-Message-State: AOAM532yM+SDjEcud5jeJtRjJX+mCcuqq3O1DLVGkZp8efGOD001BrcU pquD/ccT5rUi8AvWIWE92gDZIDvposvr4jOI X-Google-Smtp-Source: ABdhPJxDuDWwsfUjuhZqodOPLGUSr/cIXhH0BmkkuC1xuyhYvzOc6oHkhtTRtW5DAd/hRDIdEhJjpQ== X-Received: by 2002:a92:cd0e:: with SMTP id z14mr8938546iln.135.1603679929996; Sun, 25 Oct 2020 19:38:49 -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 y3sm4632838ioq.18.2020.10.25.19.38.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 19:38:49 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Stephen Warren , Stephen Warren , Simon Glass , Anatolij Gustschin , Heinrich Schuchardt , Marek Vasut , Pavel Herrmann , Sean Anderson Subject: [PATCH v2 03/11] dm: test: Add a way to run SPL tests Date: Sun, 25 Oct 2020 20:38:28 -0600 Message-Id: <20201026023836.1629465-4-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc2.309.g374f81d7ae-goog In-Reply-To: <20201026023836.1629465-1-sjg@chromium.org> References: <20201026023836.1629465-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 Add a -u flag for U-Boot SPL which requests that unit tests be run. To make this work, export dm_test_main() and update it to skip test features that are not used with of-platdata. To run the tests: $ spl/u-boot-spl -u U-Boot SPL 2020.10-rc5 (Oct 01 2020 - 07:35:39 -0600) Running 0 driver model tests Failures: 0 At present there are no SPL unit tests. Note that there is one wrinkle with these tests. SPL has limited memory available for allocation. Also malloc_simple does not free memory (free() is a nop) and running tests repeatedly causes driver-model to reinit multiple times and allocate memory. Therefore it is not possible to run more than a few tests at a time. One solution is to increase the amount of malloc space in sandbox_spl. This is not a problem for pytest, since it runs each test individually, so for now this is left as is. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- (no changes since v1) arch/sandbox/cpu/spl.c | 8 ++++++++ arch/sandbox/cpu/start.c | 9 +++++++++ arch/sandbox/include/asm/state.h | 1 + include/test/test.h | 11 +++++++++++ test/dm/test-main.c | 2 +- 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/arch/sandbox/cpu/spl.c b/arch/sandbox/cpu/spl.c index 7ab8919eb90..48fd1265afe 100644 --- a/arch/sandbox/cpu/spl.c +++ b/arch/sandbox/cpu/spl.c @@ -12,6 +12,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -67,6 +68,13 @@ void spl_board_init(void) uclass_next_device(&dev)) ; } + + if (state->run_unittests) { + int ret; + + ret = dm_test_main(NULL); + /* continue execution into U-Boot */ + } } void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index c6a2bbe4689..f5e104b127b 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -374,6 +374,15 @@ static int sandbox_cmdline_cb_show_of_platdata(struct sandbox_state *state, } SANDBOX_CMDLINE_OPT(show_of_platdata, 0, "Show of-platdata in SPL"); +static int sandbox_cmdline_cb_unittests(struct sandbox_state *state, + const char *arg) +{ + state->run_unittests = true; + + return 0; +} +SANDBOX_CMDLINE_OPT_SHORT(unittests, 'u', 0, "Run unit tests"); + static void setup_ram_buf(struct sandbox_state *state) { /* Zero the RAM buffer if we didn't read it, to keep valgrind happy */ diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h index 1bfad305f1a..f828d9d2447 100644 --- a/arch/sandbox/include/asm/state.h +++ b/arch/sandbox/include/asm/state.h @@ -92,6 +92,7 @@ struct sandbox_state { int default_log_level; /* Default log level for sandbox */ bool show_of_platdata; /* Show of-platdata in SPL */ bool ram_buf_read; /* true if we read the RAM buffer */ + bool run_unittests; /* Run unit tests */ /* Pointer to information for each SPI bus/cs */ struct sandbox_spi_info spi[CONFIG_SANDBOX_SPI_MAX_BUS] diff --git a/include/test/test.h b/include/test/test.h index 67c7d69d488..03e29290bf4 100644 --- a/include/test/test.h +++ b/include/test/test.h @@ -94,4 +94,15 @@ enum { TEST_DEVRES_SIZE3 = 37, }; +/** + * dm_test_main() - 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 + */ +int dm_test_main(const char *test_name); + #endif /* __TEST_TEST_H */ diff --git a/test/dm/test-main.c b/test/dm/test-main.c index 5560572c7c6..9d22df8c4dc 100644 --- a/test/dm/test-main.c +++ b/test/dm/test-main.c @@ -127,7 +127,7 @@ static bool dm_test_run_on_flattree(struct unit_test *test) return !strstr(fname, "video") || strstr(test->name, "video_base"); } -static int dm_test_main(const char *test_name) +int dm_test_main(const char *test_name) { struct unit_test *tests = ll_entry_start(struct unit_test, dm_test); const int n_ents = ll_entry_count(struct unit_test, dm_test); From patchwork Mon Oct 26 02:38:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1387436 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=85.214.62.61; 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=T07VG+wR; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4CKJvf4d2lz9sSn for ; Mon, 26 Oct 2020 13:39:42 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 42767824B8; Mon, 26 Oct 2020 03:39:03 +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="T07VG+wR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7723A824C4; Mon, 26 Oct 2020 03:38:55 +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,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 15D3C8248D for ; Mon, 26 Oct 2020 03:38:52 +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-io1-xd44.google.com with SMTP id k21so8482733ioa.9 for ; Sun, 25 Oct 2020 19:38:52 -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=3Z93gXoDlprHsu/NRinYkjz0uYJkLU0BDJVsYdRoQh4=; b=T07VG+wRoomsmb5sunskAJ9ZkBBFjRQfOujH6DfKy+J7yAXutBy+eIH5wJdX/wkDlU aUETTCEGn59SCx5Jre0t7JOTv1yk4OVfZBYmIjYZ10i/nlOUnuoQEmnVmETbqjww1kwX clXJz41nt3PHLcHjnj8Ux+BTC/mTHqtXTt/Tg= 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=3Z93gXoDlprHsu/NRinYkjz0uYJkLU0BDJVsYdRoQh4=; b=nMeVYyfF2LgCi3+KTt8YjxvqQIoQ9MaYRVCadUQBV4QaDN+UkJqHvhfY0nvEAlESzC vM+5fEytzp9mDse5wxjwaJT8V9iPiu9d/cBx0rb5RYsDoMOR3tGKjCLtxmIqNQC6g/xW vuptNjwQsrlr8YPx/vbxxmpsxZZmitIaGoaXKwW1FLuXmaQeK/V+mipMau031706Up6y L10M3fSPTnICOszNom+td4jBL441200WNksspiuEOe83pzlquOIgir2RJGFri9cZy4ph ZUNpkyd18APbDA9fVWfyjFNr4ZLitIn8eFXtBD8wMnfvJCRmbo/cD1G5iCwdb4riUtbB Gcug== X-Gm-Message-State: AOAM532kqckhxgS/qkcp2xks7X+AxIa60ztkI9BR71YPx/HC/jUwf0K3 4CGtyiX2pkgG8eWkXBfjKaMUY/x19CB+PgMJ X-Google-Smtp-Source: ABdhPJwJfWehvoQ5tvodN9U760o5LkdcPo946xHqrGHNie9JcGeyUnYa98xJXurEdnWwmqlSNiqHmA== X-Received: by 2002:a02:1349:: with SMTP id 70mr10050453jaz.130.1603679930861; Sun, 25 Oct 2020 19:38:50 -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 y3sm4632838ioq.18.2020.10.25.19.38.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 19:38:50 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Stephen Warren , Stephen Warren , Simon Glass , Marek Vasut , Pavel Herrmann Subject: [PATCH v2 04/11] dm: test: Add a very simple of-platadata test Date: Sun, 25 Oct 2020 20:38:29 -0600 Message-Id: <20201026023836.1629465-5-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc2.309.g374f81d7ae-goog In-Reply-To: <20201026023836.1629465-1-sjg@chromium.org> References: <20201026023836.1629465-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 At present we have a pytest that covers of-platadata. Add a very simple unit test that just checks that a device can be found. This shows the ability to write these tests in C. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- (no changes since v1) test/dm/Makefile | 4 +++- test/dm/of_platdata.c | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 test/dm/of_platdata.c diff --git a/test/dm/Makefile b/test/dm/Makefile index 2a18b5360d6..a8a590c7423 100644 --- a/test/dm/Makefile +++ b/test/dm/Makefile @@ -6,7 +6,9 @@ obj-$(CONFIG_UT_DM) += test-main.o # Tests for particular subsystems - when enabling driver model for a new # subsystem you must add sandbox tests here. -ifeq ($(CONFIG_SPL_BUILD),) +ifeq ($(CONFIG_SPL_BUILD),y) +obj-$(CONFIG_SPL_OF_PLATDATA) += of_platdata.o +else obj-$(CONFIG_UT_DM) += bus.o obj-$(CONFIG_UT_DM) += test-driver.o obj-$(CONFIG_UT_DM) += test-fdt.o diff --git a/test/dm/of_platdata.c b/test/dm/of_platdata.c new file mode 100644 index 00000000000..7a864eb0fb3 --- /dev/null +++ b/test/dm/of_platdata.c @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0+ + +#include +#include +#include +#include +#include + +/* Test that we can find a device using of-platdata */ +static int dm_test_of_platdata_base(struct unit_test_state *uts) +{ + struct udevice *dev; + + ut_assertok(uclass_first_device_err(UCLASS_SERIAL, &dev)); + ut_asserteq_str("sandbox_serial", dev->name); + + return 0; +} +DM_TEST(dm_test_of_platdata_base, UT_TESTF_SCAN_PDATA); From patchwork Mon Oct 26 02:38:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1387437 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=85.214.62.61; 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=AYj4XVlo; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4CKJvt3SSgz9sSn for ; Mon, 26 Oct 2020 13:39:54 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D8192824C5; Mon, 26 Oct 2020 03:39:05 +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="AYj4XVlo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7670F824C7; Mon, 26 Oct 2020 03:38:56 +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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (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 039CF8244A for ; Mon, 26 Oct 2020 03:38:53 +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-x144.google.com with SMTP id c11so3824989iln.9 for ; Sun, 25 Oct 2020 19:38:52 -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=djar5BhKpRnW9khoFRxZG9/Ou4P+lhqTEXzvKdMGx30=; b=AYj4XVlohHAXNOCKZj5ZtlJAl3V9gqAXDayw+Aao1zODUmSm+bjuk4JnoJ5W8EICsi wbxkyPvW4olxf9W3Z/g0QGzHg6dw9udm76HwMUC1bmkFBP5xySzIqAl/aDF7gEPHnaxF YRnz5iJy2QGhg/X4r6bEfeGj/oawPqohTZn6U= 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=djar5BhKpRnW9khoFRxZG9/Ou4P+lhqTEXzvKdMGx30=; b=EpJ/3S/qB27ZHp8cS8OZQ5qu4yJGQ6obdlwaA6U4TAQ9qOYgxYmjbSpLxygO6OnBTe KP8xIWgN/dGQUj6ddRRPR8n9Mw228trDVfR6Z8Yq4V+84ZeV4w9ahoCGkS4NbWhWqs/R ZDKOolHaST6E3Xzx4Y1+ukIsi/IWv7Q5LH3hUyeGBXc4pinY0D2JZqSmxeXe2Z36u34T 1dOK59TkIMijW1lsvcIZpc++aWxI9GF12XeSH/q06/mZgmd5Y5xayrH26rTGBCUB4u7a +zxeU/QKnUtKKqlgtxxJAEuR4gQw7puHNLC18yiwVjr3dMfAKL29C1Dl5B/Fgn2QVnJV h9iQ== X-Gm-Message-State: AOAM531hhJnUmSaNZWjoxS+QRRkXGLUp1Lo12uNdjWZKZWKVxN/sWrHj dchCcg1wjUxem6RIaYSC6LZ3ExGjPCNVHs4C X-Google-Smtp-Source: ABdhPJxOaQeYObFEmV2t6B/J408DTxqyDkKNXxQmO4uEkazINR6pmTRU8VfGgKJSuvjPdXMLOqEMPQ== X-Received: by 2002:a92:9106:: with SMTP id t6mr9805651ild.178.1603679931752; Sun, 25 Oct 2020 19:38:51 -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 y3sm4632838ioq.18.2020.10.25.19.38.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 19:38:51 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Stephen Warren , Stephen Warren , Simon Glass , Heiko Stuebner , Jan Kiszka , Kever Yang , Masahiro Yamada , Masahiro Yamada , Vignesh Raghavendra Subject: [PATCH v2 05/11] Makefile: Generate a symbol file for u-boot-spl Date: Sun, 25 Oct 2020 20:38:30 -0600 Message-Id: <20201026023836.1629465-6-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc2.309.g374f81d7ae-goog In-Reply-To: <20201026023836.1629465-1-sjg@chromium.org> References: <20201026023836.1629465-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 Add a rule to generate u-boot-spl.sym so that pytest can discover the available unit tests. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- (no changes since v1) scripts/Makefile.spl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 2e3a443035c..9f1f7445d71 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -214,7 +214,7 @@ spl/boot.bin: $(obj)/$(SPL_BIN)-align.bin FORCE $(call if_changed,mkimage) endif -INPUTS-y += $(obj)/$(SPL_BIN).bin +INPUTS-y += $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN).sym ifdef CONFIG_SAMSUNG INPUTS-y += $(obj)/$(BOARD)-spl.bin @@ -408,6 +408,11 @@ MKIMAGEFLAGS_u-boot-spl-mtk.bin = -T mtk_image \ $(obj)/u-boot-spl-mtk.bin: $(obj)/u-boot-spl.bin FORCE $(call if_changed,mkimage) +quiet_cmd_sym ?= SYM $@ + cmd_sym ?= $(OBJDUMP) -t $< > $@ +$(obj)/$(SPL_BIN).sym: $(obj)/$(SPL_BIN) FORCE + $(call if_changed,sym) + # Rule to link u-boot-spl # May be overridden by arch/$(ARCH)/config.mk quiet_cmd_u-boot-spl ?= LD $@ From patchwork Mon Oct 26 02:38:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1387438 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=Rt6nU1zc; 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 4CKJw65nLxz9sSn for ; Mon, 26 Oct 2020 13:40:06 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 62FCF824D6; Mon, 26 Oct 2020 03:39:07 +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="Rt6nU1zc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 980A2824C4; Mon, 26 Oct 2020 03:38:56 +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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (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 C806582490 for ; Mon, 26 Oct 2020 03:38:53 +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-x144.google.com with SMTP id v18so1497796ilg.1 for ; Sun, 25 Oct 2020 19:38:53 -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=UxUiyxka/4ssipVsBO3G9okyxY8AXtrCshfGK67+Is4=; b=Rt6nU1zcNPBaZ3A27QGDHF1h/gUggYZr8kgvb778uAexYwnvp7NQ41xZsJVW9ViT4C Mv0FXZ8gb8G/PSk0FxWad2sLzgg7jfTpQTxA+F/XBDQmVbloEH95bdZ1H6wUfeIuiU26 6iMH14QxbFnR3bZ24o7NjrM4T6DwrwtHJPnwo= 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=UxUiyxka/4ssipVsBO3G9okyxY8AXtrCshfGK67+Is4=; b=pX+tuEfRUor1B5OHmbRDltC91KASt6Nt37ly3drj/ZN2tzNAyTkCi56f9f/hhm06pk Ez5rVEeststxqQ7zyyc1qgT/wrZZm0j1doZ9d2RzkzAMkFhWazN4i4BfkPe0RVM2lTyo mAJ21Hfnxy/fP7FIV0E5QdglKUm0FpwVC7mWQ0Q5LFRwmGw6xh1bNyHSfSvMobIXHFm5 LNXQHDL53uQR2ctSwxBtAbfK5Hmz+FDyeiehOj90nKAyxDT6i4MNLG0ELzhKa31ar020 O8xQ2ttniOJW3mxpPveQooNNbYVFk7A6D+2Blb69F8n39o9kbObZKt5Fdxv2MIHD/KU3 jQXw== X-Gm-Message-State: AOAM532M8ALGU55Y35AQiEhY6dUe2AoAnlpaDFwHYIJqBWxtWf9yPkBc P/sLZ6SN/tRExEQZwJ9VR5erMwfBpI+iVHC+ X-Google-Smtp-Source: ABdhPJymUUdEQtLe63m/z4WsQqUc0c75lj50x3v4NtCOqwKakmg+5pDeh5Z+MRSX9BNRh3LVd5DcuA== X-Received: by 2002:a05:6e02:14b:: with SMTP id j11mr1847817ilr.109.1603679932579; Sun, 25 Oct 2020 19:38:52 -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 y3sm4632838ioq.18.2020.10.25.19.38.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 19:38:52 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Stephen Warren , Stephen Warren , Simon Glass , Cristian Ciocaltea , Heinrich Schuchardt , Marek Vasut Subject: [PATCH v2 06/11] pytest: Collect SPL unit tests Date: Sun, 25 Oct 2020 20:38:31 -0600 Message-Id: <20201026023836.1629465-7-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc2.309.g374f81d7ae-goog In-Reply-To: <20201026023836.1629465-1-sjg@chromium.org> References: <20201026023836.1629465-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 Add a new test_spl fixture to handle running SPL unit tests. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- Changes in v2: - Drop debug print() - Restart U-Boot after each SPL test test/py/conftest.py | 13 ++++++++----- test/py/tests/test_spl.py | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 test/py/tests/test_spl.py diff --git a/test/py/conftest.py b/test/py/conftest.py index 30920474b36..dc92c0be32e 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -227,7 +227,7 @@ def pytest_configure(config): console = u_boot_console_exec_attach.ConsoleExecAttach(log, ubconfig) re_ut_test_list = re.compile(r'_u_boot_list_2_(.*)_test_2_\1_test_(.*)\s*$') -def generate_ut_subtest(metafunc, fixture_name): +def generate_ut_subtest(metafunc, fixture_name, sym_path): """Provide parametrization for a ut_subtest fixture. Determines the set of unit tests built into a U-Boot binary by parsing the @@ -237,12 +237,13 @@ def generate_ut_subtest(metafunc, fixture_name): Args: metafunc: The pytest test function. fixture_name: The fixture name to test. + sym_path: Relative path to the symbol file with preceding '/' + (e.g. '/u-boot.sym') Returns: Nothing. """ - - fn = console.config.build_dir + '/u-boot.sym' + fn = console.config.build_dir + sym_path try: with open(fn, 'rt') as f: lines = f.readlines() @@ -317,10 +318,12 @@ def pytest_generate_tests(metafunc): Returns: Nothing. """ - for fn in metafunc.fixturenames: if fn == 'ut_subtest': - generate_ut_subtest(metafunc, fn) + generate_ut_subtest(metafunc, fn, '/u-boot.sym') + continue + if fn == 'ut_spl_subtest': + generate_ut_subtest(metafunc, fn, '/spl/u-boot-spl.sym') continue generate_config(metafunc, fn) diff --git a/test/py/tests/test_spl.py b/test/py/tests/test_spl.py new file mode 100644 index 00000000000..990cc9b0717 --- /dev/null +++ b/test/py/tests/test_spl.py @@ -0,0 +1,34 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright 2020 Google LLC +# Written by Simon Glass + +import os.path +import pytest + +def test_spl(u_boot_console, ut_spl_subtest): + """Execute a "ut" subtest. + + The subtests are collected in function generate_ut_subtest() from linker + generated lists by applying a regular expression to the lines of file + spl/u-boot-spl.sym. The list entries are created using the C macro + UNIT_TEST(). + + Strict naming conventions have to be followed to match the regular + expression. Use UNIT_TEST(foo_test_bar, _flags, foo_test) for a test bar in + test suite foo that can be executed via command 'ut foo bar' and is + implemented in C function foo_test_bar(). + + Args: + u_boot_console (ConsoleBase): U-Boot console + ut_subtest (str): SPL test to be executed (e.g. 'dm platdata_phandle') + """ + try: + cons = u_boot_console + cons.restart_uboot_with_flags(['-u', ut_spl_subtest]) + output = cons.get_spawn_output().replace('\r', '') + assert 'Failures: 0' in output + finally: + # Restart afterward in case a non-SPL test is run next. This should not + # happen since SPL tests are run in their own invocation of test.py, but + # the cost of doing this is not too great at present. + u_boot_console.restart_uboot() From patchwork Mon Oct 26 02:38:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1387439 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=85.214.62.61; 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=VsWvJlhl; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4CKJwL2VzGz9sSn for ; Mon, 26 Oct 2020 13:40:18 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 19BD4824E8; Mon, 26 Oct 2020 03:39:09 +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="VsWvJlhl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 43500824A7; Mon, 26 Oct 2020 03:38:57 +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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) (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 9628A824A7 for ; Mon, 26 Oct 2020 03:38:54 +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-x12a.google.com with SMTP id p16so6885821ilq.5 for ; Sun, 25 Oct 2020 19:38:54 -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=5GWS3SJHMU/S/Y54QnCj9AkaN+B+eV8n54ZhOgWFhg4=; b=VsWvJlhlusqgtaBLsVyvIVZZLAUfefpFpTc5EG+pX3QPI6m/UVmAVfBFgYbqSWBqmp ZWK0X0VNloDXFNprkbVDNb1vHYNbedW3ahFcbrJNXgwU/uP5NcKFtoVvV7huziHVYH2v Ig2m/QuhuW8V/9uuVs5yf6wtM3qpOBt1pZER4= 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=5GWS3SJHMU/S/Y54QnCj9AkaN+B+eV8n54ZhOgWFhg4=; b=ZsJHN3+fHQEJLDzFks9doEcfkvWL4xEQsfmsl2AUqmMUPEr23dT5YxP8gqO4+BkL3S XeVkqoWPowACQ9EeDMwuNnPcR7xVOuNQYx16FFbMaGaRilbOGFVcGvGOSqXLiCev9Xqd R687WI3kLMBjOJ4PuG2/9Xu47BEWRFmYcUXd5djGUkd1owGcGQfuJt9kg+EQWCZfEyTm B4cqRvPWMpebcRLbyofuec182Ss7Q1ypX7Jv5vS/QduVDgItbG7w8gmE9/NHb508vgVh /R3maomqhf6MrGKcUCC84c3IlPDCYycLBTHzB9JszJQugEZn4D95LN+7VxeI5lUM+ciU TihQ== X-Gm-Message-State: AOAM5334G25Buj9kmRcP5mWeH9CVvpDckpRe4Celm8Uv7sEt9JRU0ekx n3lYC3I8mfZDO1+BY4pqOYvXdNlstyuRm4F4 X-Google-Smtp-Source: ABdhPJyoQTUdOgS2gl/vR+8+k6pxlcUo0cVEm37IkHHCr4ymT90Fm7QPRQqFzoWEEtxgxqpbsCShVQ== X-Received: by 2002:a05:6e02:1344:: with SMTP id k4mr1091565ilr.54.1603679933355; Sun, 25 Oct 2020 19:38:53 -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 y3sm4632838ioq.18.2020.10.25.19.38.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 19:38:53 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Stephen Warren , Stephen Warren , Simon Glass Subject: [PATCH v2 07/11] test: Run SPL unit tests Date: Sun, 25 Oct 2020 20:38:32 -0600 Message-Id: <20201026023836.1629465-8-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc2.309.g374f81d7ae-goog In-Reply-To: <20201026023836.1629465-1-sjg@chromium.org> References: <20201026023836.1629465-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 Update the 'run' script to include SPL unit tests. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- (no changes since v1) test/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/run b/test/run index de87e7530b1..735628e7e37 100755 --- a/test/run +++ b/test/run @@ -28,7 +28,7 @@ fi # Run tests which require sandbox_spl run_test "sandbox_spl" ./test/py/test.py --bd sandbox_spl --build \ - -k 'test_ofplatdata or test_handoff' + -k 'test_ofplatdata or test_handoff or test_spl' if [ -z "$tools_only" ]; then # Run tests for the flat-device-tree version of sandbox. This is a special From patchwork Mon Oct 26 02:38:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1387440 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=b5AMyjsR; 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 4CKJwY4D4wz9sSn for ; Mon, 26 Oct 2020 13:40:29 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7A4328249B; Mon, 26 Oct 2020 03:39:17 +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="b5AMyjsR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EC0C3824AD; Mon, 26 Oct 2020 03:38:58 +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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (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 B86F9824C5 for ; Mon, 26 Oct 2020 03:38:55 +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-x144.google.com with SMTP id g7so6864974ilr.12 for ; Sun, 25 Oct 2020 19:38:55 -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=CSwvMrprsD6qPPl6NsHgl1/71tsZBhdzYhRfqIZfui4=; b=b5AMyjsR2K55eq1rk33wmHmlaR5mzBvSzO+QEy1avKVy/3Sj0A8Bq1Lrn8SZ7zMqfT KyxI4aFdmoil9jgESVs4FrEaxGpcPAbisOfqbtfH/CfVCl/h0VpMX0AjfB0kJLxIQArr UaKufEw9zVKbLuDE6rcdcYdpZAtUEqO0BKYRI= 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=CSwvMrprsD6qPPl6NsHgl1/71tsZBhdzYhRfqIZfui4=; b=ea1CJGXebUxHb0xvn978MHId9ls3vMCQOBOxPv8GIAsGRnJryT7SMNlJA5u+MExqsW 6qyHLOMiBHX+atEKPZd3zUt78olkHUThRNkl6nNTyhfMFLp2p28NDgF1edBbXSnoXtVv 8K27KdffcrbLobcDDyJAGoobr3DwA/scsmpIwk9SP5dlplHjZhIqfn31MrmaiI/3VGIE f2F7J3XLuOrhOaCUOZC1nq2VWBtRlUna1/s1c3nF52T9MD6I9AfO2Zk9ld+cbJMgbENf x83KrdqPX00Yyhm+o6tdgSHQXIun+DffRK9qeKVRM4UgbGzo51niogbtFRR2COa5Zxeh AbVw== X-Gm-Message-State: AOAM5336fjDkDQYqSm6mV1R1T8FWYJSFKlgclQAoMNxqFr9nmPYVU5HD eDr0FldLEUlmROndt/172Uwqgs6C2eGYpOFV X-Google-Smtp-Source: ABdhPJzJ+nIRKf1Wdz43KjTEc8wcBtDBhFJgZp38Q8BvsB8XaOWYUQ7daTcLyEYmCExf6oj1hEfkNw== X-Received: by 2002:a92:d908:: with SMTP id s8mr984222iln.173.1603679934308; Sun, 25 Oct 2020 19:38:54 -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 y3sm4632838ioq.18.2020.10.25.19.38.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 19:38:53 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Stephen Warren , Stephen Warren , Simon Glass , Anatolij Gustschin , Heinrich Schuchardt , Sean Anderson Subject: [PATCH v2 08/11] sandbox: Allow selection of SPL unit tests Date: Sun, 25 Oct 2020 20:38:33 -0600 Message-Id: <20201026023836.1629465-9-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc2.309.g374f81d7ae-goog In-Reply-To: <20201026023836.1629465-1-sjg@chromium.org> References: <20201026023836.1629465-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 Now that we have more than one test, add a way to select the test to run. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- (no changes since v1) arch/sandbox/cpu/spl.c | 2 +- arch/sandbox/cpu/start.c | 9 +++++++++ arch/sandbox/include/asm/state.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/sandbox/cpu/spl.c b/arch/sandbox/cpu/spl.c index 48fd1265afe..81b217a1d70 100644 --- a/arch/sandbox/cpu/spl.c +++ b/arch/sandbox/cpu/spl.c @@ -72,7 +72,7 @@ void spl_board_init(void) if (state->run_unittests) { int ret; - ret = dm_test_main(NULL); + ret = dm_test_main(state->select_unittests); /* continue execution into U-Boot */ } } diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index f5e104b127b..569dafbcfee 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -383,6 +383,15 @@ static int sandbox_cmdline_cb_unittests(struct sandbox_state *state, } SANDBOX_CMDLINE_OPT_SHORT(unittests, 'u', 0, "Run unit tests"); +static int sandbox_cmdline_cb_select_unittests(struct sandbox_state *state, + const char *arg) +{ + state->select_unittests = arg; + + return 0; +} +SANDBOX_CMDLINE_OPT_SHORT(select_unittests, 'k', 1, "Select unit tests to run"); + static void setup_ram_buf(struct sandbox_state *state) { /* Zero the RAM buffer if we didn't read it, to keep valgrind happy */ diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h index f828d9d2447..7547602dd1c 100644 --- a/arch/sandbox/include/asm/state.h +++ b/arch/sandbox/include/asm/state.h @@ -93,6 +93,7 @@ struct sandbox_state { bool show_of_platdata; /* Show of-platdata in SPL */ bool ram_buf_read; /* true if we read the RAM buffer */ bool run_unittests; /* Run unit tests */ + const char *select_unittests; /* Unit test to run */ /* Pointer to information for each SPI bus/cs */ struct sandbox_spi_info spi[CONFIG_SANDBOX_SPI_MAX_BUS] From patchwork Mon Oct 26 02:38:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1387441 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=mNLkk831; 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 4CKJwl5T0kz9sSn for ; Mon, 26 Oct 2020 13:40:39 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 78B13824F1; Mon, 26 Oct 2020 03:39:18 +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="mNLkk831"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 150BD824A7; Mon, 26 Oct 2020 03:38:59 +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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (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 7C65C8244A for ; Mon, 26 Oct 2020 03:38:56 +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-x144.google.com with SMTP id n5so6865957ile.7 for ; Sun, 25 Oct 2020 19:38:56 -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=3fSooPqSeQn784GjRts7Qmdc6kypt6RkjzU4GagpKhE=; b=mNLkk831vpDRY51kabeB8uKA6WORvLDp6/WshdcxPqvmFqejgr0f5hEXNst2spNUey AFoNy/A6JLxneV6a+5Q6yyf5S1dq6kOdpZb0lxPIEmo5J48raF0gF1vEk6ztNYLS9xpy lUHL9napT3fbpWemZX0jv0h6h3sTaKzoBAtbA= 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=3fSooPqSeQn784GjRts7Qmdc6kypt6RkjzU4GagpKhE=; b=k5rSlPknMucxtJ3ddUTycrhI0NH2idpbfueCGdkdEeGeW7fnRWGZdNAgqgOgog7Uy8 gSEvjBRhoxOF9VQoEDYSGn3TZjl9Rk20I8OEk8rJIB/lIQQ5ZZxjJgEkSPuuy13usNKU 4f0Y3klz7iHKm5gX5w/aU4gC8WcFGQ8kPDElubQK+Zcr52vk3E4PnPjVjR3hSu6Pnqx6 U4ZiV3iKFkIbr0FZkoKtH7sYvVVrowlGQmA1LvTE53C2ID0QwIdkMdCb2Ye2G92P1TCI KZib++sfumESeCdkiziby2nHYgQuThblzdMMakIY6twALnKRETwrtvRV4Ij1JSJfxfb2 8UaQ== X-Gm-Message-State: AOAM532gJp2oOWR6ZQo9pygFvP8LfbBDafb7uTzv0u19qYkXIOHxOJ2i y4SbMrCMEIUIHL1YknyC5dONneJe08YCyCNy X-Google-Smtp-Source: ABdhPJzbUxcHOenjJ9imHYyFnRTAQw7/fCjktnJ5IVrvuWpSia5TUta2q62n1JCBDmqPt+lTln4Igw== X-Received: by 2002:a92:740c:: with SMTP id p12mr8853054ilc.277.1603679935344; Sun, 25 Oct 2020 19:38:55 -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 y3sm4632838ioq.18.2020.10.25.19.38.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 19:38:54 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Stephen Warren , Stephen Warren , Simon Glass Subject: [PATCH v2 09/11] test: Run only the selected SPL test Date: Sun, 25 Oct 2020 20:38:34 -0600 Message-Id: <20201026023836.1629465-10-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc2.309.g374f81d7ae-goog In-Reply-To: <20201026023836.1629465-1-sjg@chromium.org> References: <20201026023836.1629465-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 Use the new -k option to select the test to run. Signed-off-by: Simon Glass --- Changes in v2: - Separate out this patch from the next series and include it here test/py/tests/test_spl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/py/tests/test_spl.py b/test/py/tests/test_spl.py index 990cc9b0717..bd273dad893 100644 --- a/test/py/tests/test_spl.py +++ b/test/py/tests/test_spl.py @@ -24,7 +24,7 @@ def test_spl(u_boot_console, ut_spl_subtest): """ try: cons = u_boot_console - cons.restart_uboot_with_flags(['-u', ut_spl_subtest]) + cons.restart_uboot_with_flags(['-u', '-k', ut_spl_subtest.split()[1]]) output = cons.get_spawn_output().replace('\r', '') assert 'Failures: 0' in output finally: From patchwork Mon Oct 26 02:38:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1387442 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=85.214.62.61; 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=SW+crxhH; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4CKJwy44cWz9sSn for ; Mon, 26 Oct 2020 13:40:50 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CDCA282504; Mon, 26 Oct 2020 03:39:19 +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="SW+crxhH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A9089824C5; Mon, 26 Oct 2020 03:39:00 +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, T_FILL_THIS_FORM_SHORT,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) (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 A4CFB82490 for ; Mon, 26 Oct 2020 03:38: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=sjg@chromium.org Received: by mail-il1-x143.google.com with SMTP id y17so6891711ilg.4 for ; Sun, 25 Oct 2020 19:38:57 -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=utpRL0W87qm+1qAZ2jbVqjW3Y2gPBbsq6+B+KW+WG1M=; b=SW+crxhH4EKGCymSTQmUxsERUntZpMphaFq3+xPgWY2K2Yq9+eHzyiJe914erX6fk8 qKTeSpwSDdKq4t69kwu0wADljjpmAqfdMbIB0CSJ+fg+AqN9tW5qIDFJAOwm5thtxWsO PU1il2gNkqsmxArhtbj9bhhkfHWopEwM0cbxM= 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=utpRL0W87qm+1qAZ2jbVqjW3Y2gPBbsq6+B+KW+WG1M=; b=GLenX9fSUh9Vt9RddZrhGsG9hAGGKDxwSvCxt8Wgje1dH31T1jUd6mYqChzj4ki6Jq Lr+RraZxEY3Oha3m8m78ibeNc6bsB2ff6egoficIK48KsyHIxqJmGpAWygIlXMaTG3JY yuZR2qZwZ2jb1FyGwqP9lySJ1CHFjvx6+Ur2ir/IUV+hNNN9J8exCpB3jOenwjIHB35S Z0JB1hfT0swn8RDR1z1ZX/GBv8o8FmwGruRK9U6oRoeZnmKcBQR3v/DNpjVgsplO1Tj2 i3UlOHnr9c/iTeKN93fu5+JgwUAMK7v769QptpMZ4LfSbdcXTYqFeTA40x/cMK2KxJFc JH3g== X-Gm-Message-State: AOAM532xRsj6eYFcAqk2JTm+2fGKiCkVu0z/vDegS+Dg9SCTU9saGaZ9 P68PMHokVnL07L6OOGx0ejHipsEKaOtSjN/P X-Google-Smtp-Source: ABdhPJyadKmZQROVaWk9iHuZYx37OYaQA45Mk/HH+rb0OI8DoFL44sfoPoqeZjR4q4KC4oWB4NzQSQ== X-Received: by 2002:a92:8545:: with SMTP id f66mr3519927ilh.206.1603679936390; Sun, 25 Oct 2020 19:38:56 -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 y3sm4632838ioq.18.2020.10.25.19.38.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 19:38:56 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Stephen Warren , Stephen Warren , Simon Glass , Anatolij Gustschin , Heinrich Schuchardt , Marek Vasut , Pavel Herrmann , Sean Anderson Subject: [PATCH v2 10/11] dm: test: Drop of-platdata pytest Date: Sun, 25 Oct 2020 20:38:35 -0600 Message-Id: <20201026023836.1629465-11-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc2.309.g374f81d7ae-goog In-Reply-To: <20201026023836.1629465-1-sjg@chromium.org> References: <20201026023836.1629465-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 Now that we have a C version of this test, drop the Python implementation. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- (no changes since v1) arch/sandbox/cpu/spl.c | 12 -------- arch/sandbox/cpu/start.c | 9 ------ arch/sandbox/include/asm/state.h | 1 - drivers/misc/spltest_sandbox.c | 35 ------------------------ test/py/tests/test_ofplatdata.py | 47 -------------------------------- 5 files changed, 104 deletions(-) diff --git a/arch/sandbox/cpu/spl.c b/arch/sandbox/cpu/spl.c index 81b217a1d70..9a77da15619 100644 --- a/arch/sandbox/cpu/spl.c +++ b/arch/sandbox/cpu/spl.c @@ -54,20 +54,8 @@ SPL_LOAD_IMAGE_METHOD("sandbox", 9, BOOT_DEVICE_BOARD, spl_board_load_image); void spl_board_init(void) { struct sandbox_state *state = state_get_current(); - struct udevice *dev; preloader_console_init(); - if (state->show_of_platdata) { - /* - * Scan all the devices so that we can output their platform - * data. See sandbox_spl_probe(). - */ - printf("Scanning misc devices\n"); - for (uclass_first_device(UCLASS_MISC, &dev); - dev; - uclass_next_device(&dev)) - ; - } if (state->run_unittests) { int ret; diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index 569dafbcfee..58ada13fba5 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -365,15 +365,6 @@ static int sandbox_cmdline_cb_log_level(struct sandbox_state *state, SANDBOX_CMDLINE_OPT_SHORT(log_level, 'L', 1, "Set log level (0=panic, 7=debug)"); -static int sandbox_cmdline_cb_show_of_platdata(struct sandbox_state *state, - const char *arg) -{ - state->show_of_platdata = true; - - return 0; -} -SANDBOX_CMDLINE_OPT(show_of_platdata, 0, "Show of-platdata in SPL"); - static int sandbox_cmdline_cb_unittests(struct sandbox_state *state, const char *arg) { diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h index 7547602dd1c..bca13069824 100644 --- a/arch/sandbox/include/asm/state.h +++ b/arch/sandbox/include/asm/state.h @@ -90,7 +90,6 @@ struct sandbox_state { bool skip_delays; /* Ignore any time delays (for test) */ bool show_test_output; /* Don't suppress stdout in tests */ int default_log_level; /* Default log level for sandbox */ - bool show_of_platdata; /* Show of-platdata in SPL */ bool ram_buf_read; /* true if we read the RAM buffer */ bool run_unittests; /* Run unit tests */ const char *select_unittests; /* Unit test to run */ diff --git a/drivers/misc/spltest_sandbox.c b/drivers/misc/spltest_sandbox.c index 999031625b5..3ae6707593e 100644 --- a/drivers/misc/spltest_sandbox.c +++ b/drivers/misc/spltest_sandbox.c @@ -8,43 +8,8 @@ #include #include -static int sandbox_spl_probe(struct udevice *dev) -{ - struct dtd_sandbox_spl_test *plat = dev_get_platdata(dev); - int i; - - printf("of-platdata probe:\n"); - printf("bool %d\n", plat->boolval); - - printf("byte %02x\n", plat->byteval); - printf("bytearray"); - for (i = 0; i < sizeof(plat->bytearray); i++) - printf(" %02x", plat->bytearray[i]); - printf("\n"); - - printf("int %d\n", plat->intval); - printf("intarray"); - for (i = 0; i < ARRAY_SIZE(plat->intarray); i++) - printf(" %d", plat->intarray[i]); - printf("\n"); - - printf("longbytearray"); - for (i = 0; i < sizeof(plat->longbytearray); i++) - printf(" %02x", plat->longbytearray[i]); - printf("\n"); - - printf("string %s\n", plat->stringval); - printf("stringarray"); - for (i = 0; i < ARRAY_SIZE(plat->stringarray); i++) - printf(" \"%s\"", plat->stringarray[i]); - printf("\n"); - - return 0; -} - U_BOOT_DRIVER(sandbox_spl_test) = { .name = "sandbox_spl_test", .id = UCLASS_MISC, .flags = DM_FLAG_PRE_RELOC, - .probe = sandbox_spl_probe, }; diff --git a/test/py/tests/test_ofplatdata.py b/test/py/tests/test_ofplatdata.py index 13154935b9b..78837a3c008 100644 --- a/test/py/tests/test_ofplatdata.py +++ b/test/py/tests/test_ofplatdata.py @@ -4,53 +4,6 @@ import pytest import u_boot_utils as util -OF_PLATDATA_OUTPUT = ''' -of-platdata probe: -bool 1 -byte 05 -bytearray 06 00 00 -int 1 -intarray 2 3 4 0 -longbytearray 09 0a 0b 0c 0d 0e 0f 10 11 -string message -stringarray "multi-word" "message" "" -of-platdata probe: -bool 0 -byte 08 -bytearray 01 23 34 -int 3 -intarray 5 0 0 0 -longbytearray 09 0a 0b 0c 00 00 00 00 00 -string message2 -stringarray "another" "multi-word" "message" -of-platdata probe: -bool 0 -byte 00 -bytearray 00 00 00 -int 0 -intarray 0 0 0 0 -longbytearray 00 00 00 00 00 00 00 00 00 -string -stringarray "one" "" "" -of-platdata probe: -bool 0 -byte 00 -bytearray 00 00 00 -int 0 -intarray 0 0 0 0 -longbytearray 00 00 00 00 00 00 00 00 00 -string -stringarray "spl" "" "" -''' - -@pytest.mark.buildconfigspec('spl_of_platdata') -def test_ofplatdata(u_boot_console): - """Test that of-platdata can be generated and used in sandbox""" - cons = u_boot_console - cons.restart_uboot_with_flags(['--show_of_platdata']) - output = cons.get_spawn_output().replace('\r', '') - assert OF_PLATDATA_OUTPUT in output - @pytest.mark.buildconfigspec('spl_of_platdata') def test_spl_devicetree(u_boot_console): """Test content of spl device-tree""" From patchwork Mon Oct 26 02:38:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1387443 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=kM+bHoOM; 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 4CKJx76SdCz9sSn for ; Mon, 26 Oct 2020 13:40:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 383FB8250D; Mon, 26 Oct 2020 03:39:21 +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="kM+bHoOM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 44C74824C7; Mon, 26 Oct 2020 03:39:04 +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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) (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 C215C824A8 for ; Mon, 26 Oct 2020 03:38:58 +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-io1-xd35.google.com with SMTP id u62so8484339iod.8 for ; Sun, 25 Oct 2020 19:38:58 -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=cDcvP1m/E4S5DqeQ8TU17vywKIO0+K9p2lrVpd7nAl4=; b=kM+bHoOM7Dg/0Ro/QyYt8ocg7LKgjPI62c4CvYZSCu3+Zl0ohGZYzhjupufE9oxxir EnRVWYiO1XDN45IK2EqosjteuuwzZNaqGT2WIp2nfNFkeQYu3fBSQkCX2Xt99Ks15iUV W3Gg+HxCTL/9t5SbA4qxlZH7wDnFQB5mDMlUc= 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=cDcvP1m/E4S5DqeQ8TU17vywKIO0+K9p2lrVpd7nAl4=; b=JSALKSbUu29xqR/V2u5CrLhBpkPp2/Aci/6RZxNSnsQxrbnMqU7dbGT8BuDo5JPedg SGHa/BEljpsdabOJZkWwhsWDw0+eG2QmB8iPZwwANtimtV9Zf4H1uj6gWML6X1OwXn3s a72J9x0Cbj6SNjFkx+O9fls2ZrIpO1ZUyDvYbZMnn3ncPlb7SLEFH5RTPW/q7XIUgE33 MyxzUd/xzoNnnb/P9X8O/u03S0bXQ5GS3JP7u4FMS16Ad4+J7p0n6/UqyifrbOnUhiy7 BYN10jHfwjvdygAAieBJVJw2YHEXy2NYCc3kOvggnBM0CY08njfDMUqWuFIWS7CB7ezS qK5Q== X-Gm-Message-State: AOAM533+GIsNTDb9hyX7bDFb8LPzFJTPvGcB+xz3R2pJU4QoIkLWgNtb awd0vsR0TQ0nLc3XMMYGyh2QPfhe6eXpPQ28 X-Google-Smtp-Source: ABdhPJzMbvYttB+7mE293i3BZp5OHU78IjMyWRdehp4s5mWLB3SVucAaWzwHvQo8PqiluftzDOUbQA== X-Received: by 2002:a5d:91c7:: with SMTP id k7mr8869551ior.74.1603679937443; Sun, 25 Oct 2020 19:38:57 -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 y3sm4632838ioq.18.2020.10.25.19.38.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 19:38:57 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Stephen Warren , Stephen Warren , Simon Glass , Bin Meng , Daniel Schwierzeck , Heiko Schocher , Heinrich Schuchardt , Marek Vasut Subject: [PATCH v2 11/11] Azure/GitLab/Travis: Add SPL unit tests Date: Sun, 25 Oct 2020 20:38:36 -0600 Message-Id: <20201026023836.1629465-12-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc2.309.g374f81d7ae-goog In-Reply-To: <20201026023836.1629465-1-sjg@chromium.org> References: <20201026023836.1629465-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 Run SPL unit tests in all test environments. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- (no changes since v1) .azure-pipelines.yml | 2 +- .gitlab-ci.yml | 2 +- .travis.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 473ddee3835..a78c8d61300 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -182,7 +182,7 @@ jobs: OVERRIDE: "-O clang-10" sandbox_spl: TEST_PY_BD: "sandbox_spl" - TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff" + TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl" sandbox_flattree: TEST_PY_BD: "sandbox_flattree" evb_ast2500: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9ac2b336a11..b1e0b3bc9dd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -198,7 +198,7 @@ sandbox_spl test.py: tags: [ 'all' ] variables: TEST_PY_BD: "sandbox_spl" - TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff" + TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl" <<: *buildman_and_testpy_dfn evb-ast2500 test.py: diff --git a/.travis.yml b/.travis.yml index fb8f73157d7..cb48ff3023a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -512,7 +512,7 @@ matrix: - name: "test/py sandbox_spl" env: - TEST_PY_BD="sandbox_spl" - TEST_PY_TEST_SPEC="test_ofplatdata or test_handoff" + TEST_PY_TEST_SPEC="test_ofplatdata or test_handoff or test_spl" TOOLCHAIN="i386" TEST_PY_TOOLS="yes" - name: "test/py sandbox_flattree"