From patchwork Mon Oct 26 02:38:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1387433 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=LLqaUGUg; 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) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CKJv02wKCz9sSn for ; Mon, 26 Oct 2020 13:38:58 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BFEE182465; 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=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="LLqaUGUg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 846EE8246A; Mon, 26 Oct 2020 03:38:48 +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-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (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 B17C98244A for ; Mon, 26 Oct 2020 03:38:45 +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-x141.google.com with SMTP id k6so1619063ilq.2 for ; Sun, 25 Oct 2020 19:38:45 -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:mime-version :content-transfer-encoding; bh=duCGaAb9iaG7FiorwrDR9kb9yi9hmmq2sTJJUNMKkvU=; b=LLqaUGUgZ5UppnNQqM7dPYBR3lCz93ghG9OEjYY8D6rpvFNBA0AbMA4+KSc3K4NfI4 wvk7D2u/tLU6RQvfB8nHS3Q6W/QitkfrZ/PqTSmv+kniQEKR22FC0QJR/3VaWxiABv1Y U54KMOi0jYFra9M4P+tQ3YJcWMcV6fP1xBjT4= 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:mime-version :content-transfer-encoding; bh=duCGaAb9iaG7FiorwrDR9kb9yi9hmmq2sTJJUNMKkvU=; b=Byc8BFtDgkG16wdjbABlhQPBsB/fcx/VMxkDgBmYQtDK+/0WXiFaHQBoykUBJYQSzv 3c/JCA/8njL4q78xN2c6QY2unRIbGgDX3RG/d4uk3j/4l2H0eYiroX3hEpH40qewHR9t Shp5A79TRnQGIDeMppJJ3y4s2JHS0cIKWZeaeWs/3zPyjxl3vxPrg9E/q32NEl6Zd4eV 1PxF/QsPe6kqqs/Ip+6QPFA0+YUQ+ip0Ypckp9dj8GyI52swXCAQZJl42pqMOKnjPiNj 5mk037uiR2kJAg/tDrWlKA210AZEJVN0RfMVzInCkQZ6HhJk99wO3rXhi8KwFAPpBZAY V4Mw== X-Gm-Message-State: AOAM53165Krn9WPCzquWJJuFS38E2VeH29xOPxKi1f+PsELy7U74hq2x oNQ7waGJkQ9807ADLnk2qGljRp6W/aj/9rrL X-Google-Smtp-Source: ABdhPJx355MX6Fz3M9QBk5PE9D5GlcrcvTUqDvMbORLjxrc9lsa4JlUC0P3FvznmObVPMNV2QwILAw== X-Received: by 2002:a92:c84e:: with SMTP id b14mr1465508ilq.295.1603679924160; Sun, 25 Oct 2020 19:38:44 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 19:38:43 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Stephen Warren , Stephen Warren , Simon Glass , AKASHI Takahiro , Anatolij Gustschin , Bin Meng , Cristian Ciocaltea , Daniel Schwierzeck , Heiko Schocher , Heiko Stuebner , Heinrich Schuchardt , Jan Kiszka , Jean-Jacques Hiblot , Kever Yang , Marek Vasut , Marek Vasut , Masahiro Yamada , Masahiro Yamada , Pavel Herrmann , Sean Anderson , Vignesh Raghavendra Subject: [PATCH v2 00/11] dm: test: Add unit tests for SPL Date: Sun, 25 Oct 2020 20:38:25 -0600 Message-Id: <20201026023836.1629465-1-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc2.309.g374f81d7ae-goog 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 U-Boot has about 700 tests but only a handful of these target SPL. This is partly because SPL has limited functionality and does not have a command interface to initiate tests. The current SPL tests are targeted at sandbox_spl and are initiated from pytest. With SPL tests written in C, we can check the behaviour of of-platdata more easily, since the test can check things directly rather than printing out information for pytest to check. This series adds support for SPL tests written in C, targeted at the sandbox_spl build. It includes quite a bit of minor refactoring to get everything working. Changes in v2: - Drop debug print() - Restart U-Boot after each SPL test - Separate out this patch from the next series and include it here Simon Glass (11): dm: test: Build tests for SPL dm: test: Update the test runner to support of-platdata dm: test: Add a way to run SPL tests dm: test: Add a very simple of-platadata test Makefile: Generate a symbol file for u-boot-spl pytest: Collect SPL unit tests test: Run SPL unit tests sandbox: Allow selection of SPL unit tests test: Run only the selected SPL test dm: test: Drop of-platdata pytest Azure/GitLab/Travis: Add SPL unit tests .azure-pipelines.yml | 2 +- .gitlab-ci.yml | 2 +- .travis.yml | 2 +- arch/sandbox/cpu/spl.c | 18 +++++------- arch/sandbox/cpu/start.c | 15 ++++++++-- arch/sandbox/include/asm/state.h | 3 +- configs/sandbox_spl_defconfig | 2 +- drivers/misc/spltest_sandbox.c | 35 ------------------------ include/test/test.h | 11 ++++++++ scripts/Makefile.spl | 8 +++++- test/Kconfig | 10 +++++++ test/dm/Makefile | 4 ++- test/dm/of_platdata.c | 19 +++++++++++++ test/dm/test-main.c | 29 ++++++++++++-------- test/py/conftest.py | 13 +++++---- test/py/tests/test_ofplatdata.py | 47 -------------------------------- test/py/tests/test_spl.py | 34 +++++++++++++++++++++++ test/run | 2 +- 18 files changed, 135 insertions(+), 121 deletions(-) create mode 100644 test/dm/of_platdata.c create mode 100644 test/py/tests/test_spl.py