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]