From patchwork Sun Sep 23 22:47:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 973768 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42JMz71CZXz9s5c for ; Mon, 24 Sep 2018 08:52:03 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id C2CB3C21F67; Sun, 23 Sep 2018 22:49:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id E1105C21F69; Sun, 23 Sep 2018 22:47:59 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 597BBC21F60; Sun, 23 Sep 2018 22:47:50 +0000 (UTC) Received: from mail-io1-f73.google.com (mail-io1-f73.google.com [209.85.166.73]) by lists.denx.de (Postfix) with ESMTPS id 93F2CC21F60 for ; Sun, 23 Sep 2018 22:47:46 +0000 (UTC) Received: by mail-io1-f73.google.com with SMTP id k9-v6so36740412iob.16 for ; Sun, 23 Sep 2018 15:47:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=gdDpg/1g7L/U5uJ1PrWKY6OyOuDI/T0rnDOwRSiWW/4=; b=oWW5R+e2XxiAeFDgcrXp5HkGlKPzfTa1mrkZ5SabbiD31KVX8y38SO8KlWL0G2MIQB 7syorhBtjCLEN0c+6xmxkq3EacMQbc+GE1lksy7CCPNI4g/S3oOMea8Kza9HJYhrBnxW 8pHx8uZnJpyRWv7s9TeFVykk64FF315+pPpgG60/zEjAq9W7FSeI09fVSpxCcN0jHDfu 6PcSeJqBPA+Y920ec8wGCdR1F1sVBAA6D/QZd7fOaYr+DQOB0ssefGme4WlGDG72itdp R7FXd1OBz63PfUB9T86bzQOS/iaCZvxdI/YAe6VU+AVFsA36thQMD7ijjY3gx/r1KB8Z pHPw== X-Gm-Message-State: APzg51CaCyJCgMEsHb3Qdkwl6pRFyQk5JtgD7DjuaxI5dylUy+VITKbH zu/CC+dXBQ92/YTw4tP6UzK7VGA= X-Google-Smtp-Source: ANB0VdbgG55Ou1TxLIHvGhpf+xd5zo8e2ML1dWecU8Mk217+LqahEhTrbMqatC9g96WlVjSjWqFuwKo= X-Received: by 2002:a24:5249:: with SMTP id d70-v6mr6335751itb.0.1537742865650; Sun, 23 Sep 2018 15:47:45 -0700 (PDT) Date: Sun, 23 Sep 2018 16:47:20 -0600 In-Reply-To: <20180923224727.204542-1-sjg@chromium.org> Message-Id: <20180923224727.204542-9-sjg@chromium.org> Mime-Version: 1.0 References: <20180923224727.204542-1-sjg@chromium.org> X-Mailer: git-send-email 2.19.0.444.g18242da7ef-goog From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Stephen Warren Subject: [U-Boot] [PATCH 08/15] test: Print the name of each test before running it X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" At present the tests are run without any indication of what is running. For the tests which start with a build this is pretty obvious, but for tools it is not. Add a name for each test we run, and print it before starting the test. Signed-off-by: Simon Glass --- test/run | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/test/run b/test/run index 6b73813f9bc..b997d4bc2a4 100755 --- a/test/run +++ b/test/run @@ -1,6 +1,13 @@ #!/bin/bash +# Script to run all U-Boot tests that use sandbox. + +# Runs a test and checks the exit code to decide if it passed +# $1: Test name +# $2 onwards: command line to run run_test() { + echo -n "$1: " + shift $@ [ $? -ne 0 ] && result=$((result+1)) } @@ -8,13 +15,14 @@ run_test() { result=0 # Run all tests that the standard sandbox build can support -run_test ./test/py/test.py --bd sandbox --build +run_test "sandbox" ./test/py/test.py --bd sandbox --build # Run tests which require sandbox_spl -run_test ./test/py/test.py --bd sandbox_spl --build -k test_ofplatdata.py +run_test "sandbox_spl" ./test/py/test.py --bd sandbox_spl --build \ + -k test_ofplatdata.py # Run tests for the flat DT version of sandbox -./test/py/test.py --bd sandbox_flattree --build +run_test "sandbox_flattree" ./test/py/test.py --bd sandbox_flattree --build # Set up a path to dtc (device-tree compiler) and libfdt.py, a library it # provides and which is built by the sandbox_spl config. @@ -22,17 +30,17 @@ DTC_DIR=build-sandbox_spl/scripts/dtc export PYTHONPATH=${DTC_DIR}/pylibfdt export DTC=${DTC_DIR}/dtc -run_test ./tools/binman/binman -t -run_test ./tools/patman/patman --test -run_test ./tools/buildman/buildman -t -run_test ./tools/dtoc/dtoc -t +run_test "binman" ./tools/binman/binman -t +run_test "patman" ./tools/patman/patman --test +run_test "buildman" ./tools/buildman/buildman -t +run_test "dtoc" ./tools/dtoc/dtoc -t # This needs you to set up Python test coverage tools. # To enable Python test coverage on Debian-type distributions (e.g. Ubuntu): # $ sudo apt-get install python-pytest python-coverage -run_test ./tools/binman/binman -T -run_test ./tools/dtoc/dtoc -T -run_test ./tools/dtoc/test_fdt -T +run_test "binman code coverage" ./tools/binman/binman -T +run_test "dtoc code coverage" ./tools/dtoc/dtoc -T +run_test "fdt code coverage" ./tools/dtoc/test_fdt -T if [ $result == 0 ]; then echo "Tests passed!"