From patchwork Wed Sep 6 08:02:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9940035 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F21536035F for ; Wed, 6 Sep 2017 08:03:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E171428B1D for ; Wed, 6 Sep 2017 08:03:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4AB028B22; Wed, 6 Sep 2017 08:03:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7452328B1D for ; Wed, 6 Sep 2017 08:03:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1EA1989BC2; Wed, 6 Sep 2017 08:03:01 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7CAC789BC2 for ; Wed, 6 Sep 2017 08:02:59 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id 187so4724311wmn.0 for ; Wed, 06 Sep 2017 01:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QM4FkbNuh16yA8x/FFPqJeeGTb6TTfig9qSYQl/I/FI=; b=gO60u12VSIvrDsWZXBPbg8Vc40fDPLFEgku4+MEILrA29QLav8ag3X3svMxSIeQvie w4MApuyUJO6vMOGDtUyUHyAWP/Lt/To9JFb2S1R3lYsPOoL6q2aB8656SwJWnwlHNkgL 8YSe0F3G78+H9D8CZci1rhKauRp/wg3zNwqa8= 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; bh=QM4FkbNuh16yA8x/FFPqJeeGTb6TTfig9qSYQl/I/FI=; b=P20glJzpmlUns9Rak1OWOVxKTUtsTLKh7vguZpVKChklmIc/merd2Ufo8aJiuVuvkq WnOxSsG+mYlBRUZmsDI0acDUl1Pl1mlXOJv8a+vuQD8KivKa+UA5YWdBcqoP0W99BBc/ 7IOfTislrzTZfaxx2qv069J4OYNxm/v7nG1+2POL7f13ZejKifXjQZlxFX+iqsIP6/YB v21HGf9QESADq9huwwwAzhas0QBlZORWMvqFs6ci9KXX3iVYfcOK8lp2GMtw7XmLAFNe zqnHGcnfUyMgARWR37NAovMud3YqOzJ6XcUZm6wFLZuEfIsgfCXiTrHa5MyF2I5cN3Cv bxgg== X-Gm-Message-State: AHPjjUhisdiL+KvMXq2G5fmGlvyC0Pjk2hWS6pE8xs2k0ntlFVyE3vTu nGtteiDlAVTJA14qpCo= X-Google-Smtp-Source: ADKCNb6aSDOvqS0TYnMSFO8AY/uCFau+6m8g42auJyaM6lJZo7h3ukRfHDAuJy+50RNzGWYQKH7K7A== X-Received: by 10.80.157.73 with SMTP id j9mr5446475edk.151.1504684977620; Wed, 06 Sep 2017 01:02:57 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5635:0:39d2:f87e:2033:9f6]) by smtp.gmail.com with ESMTPSA id i93sm1036132edc.53.2017.09.06.01.02.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Sep 2017 01:02:56 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Wed, 6 Sep 2017 10:02:52 +0200 Message-Id: <20170906080252.9986-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170905164310.12609-1-daniel.vetter@ffwll.ch> References: <20170905164310.12609-1-daniel.vetter@ffwll.ch> Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH i-g-t] tests/igt_command_line.sh: Allow testing individual tests X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP meso will use this to run the tests for all testcases in parallel, for great speedup! v2: Fix bugs in the conversion. Oops, I broke the automake build. v3: Try harder at being posix shell compliant. Signed-off-by: Daniel Vetter --- tests/igt_command_line.sh | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh index 7f80fc805d37..57d105e958ae 100755 --- a/tests/igt_command_line.sh +++ b/tests/igt_command_line.sh @@ -37,26 +37,19 @@ fi # Manually running this script is possible in the source root or the # tests directory. -TESTLISTFILE="$tests_dir/test-list.txt" -if [ ! -r "$TESTLISTFILE" ]; then - tests_dir="tests" - TESTLISTFILE="$tests_dir/test-list.txt" -fi - -TESTLIST=`cat $TESTLISTFILE` -if [ $? -ne 0 ]; then - echo "Error: Could not read test lists" - exit 99 -fi - fail () { echo "FAIL: $1" exit 1 } -for test in $TESTLIST; do +check_test () +{ + local test + + test=$1 + if [ "$test" = "TESTLIST" -o "$test" = "END" ]; then - continue + return fi testname="$test" @@ -105,4 +98,25 @@ for test in $TESTLIST; do # check invalid subtest handling echo " Checking invalid subtest handling..." ./$test --run-subtest invalid-subtest > /dev/null 2>&1 && fail $test +} + +TESTLISTFILE="$tests_dir/test-list.txt" +if [ ! -r "$TESTLISTFILE" ]; then + tests_dir="tests" + TESTLISTFILE="$tests_dir/test-list.txt" +fi + +TESTLIST=`cat $TESTLISTFILE` +if [ $? -ne 0 ]; then + echo "Error: Could not read test lists" + exit 99 +fi + +if [[ "$1" != "" ]] ; then + check_test $1 + exit 0 +fi + +for test in $TESTLIST; do + check_test $test done