From patchwork Tue Mar 21 12:50:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Latvala X-Patchwork-Id: 9636557 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 B7100602CC for ; Tue, 21 Mar 2017 12:50:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9DBF27C0B for ; Tue, 21 Mar 2017 12:50:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9EFB128304; Tue, 21 Mar 2017 12:50:24 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 60FC127C0B for ; Tue, 21 Mar 2017 12:50:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E80446E59A; Tue, 21 Mar 2017 12:50:22 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from johanna3.inet.fi (mta-out1.inet.fi [62.71.2.229]) by gabe.freedesktop.org (Postfix) with ESMTP id 98ECD6E43F for ; Tue, 21 Mar 2017 12:50:21 +0000 (UTC) RazorGate-KAS: Status: not_detected RazorGate-KAS: Rate: 0 RazorGate-KAS: Envelope from: RazorGate-KAS: Version: 5.5.3 RazorGate-KAS: LuaCore: 80 2014-11-10_18-01-23 260f8afb9361da3c7edfd3a8e3a4ca908191ad29 RazorGate-KAS: Lua profiles 69136 [Nov 12 2014] RazorGate-KAS: Method: none Received: from hufflepuff.adrinael.net (84.250.112.128) by johanna3.inet.fi (9.0.002.03-2-gbe5d057) id 58CF969F002DF61D; Tue, 21 Mar 2017 14:50:20 +0200 Received: from adrinael by hufflepuff.adrinael.net with local (Exim 4.84_2) (envelope-from ) id 1cqJEy-0000oW-P1; Tue, 21 Mar 2017 14:50:20 +0200 From: Petri Latvala To: intel-gfx@lists.freedesktop.org Date: Tue, 21 Mar 2017 14:50:09 +0200 Message-Id: <1490100610-3069-2-git-send-email-petri.latvala@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1490100610-3069-1-git-send-email-petri.latvala@intel.com> References: <1490100610-3069-1-git-send-email-petri.latvala@intel.com> Subject: [Intel-gfx] [PATCH i-g-t 2/3] igt_command_line.sh: Actually check things during distcheck 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 This script is invoked in several different ways and the directories to use vary depending on the invocation. The handling of test-list.txt has been working before, but executing the individual command line handling tests have just skipped everything except shell scripts. Now "make distcheck" checks everything "make check" does, as does executing the script by hand. Signed-off-by: Petri Latvala --- tests/igt_command_line.sh | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh index 69fa843..7f80fc8 100755 --- a/tests/igt_command_line.sh +++ b/tests/igt_command_line.sh @@ -25,19 +25,28 @@ # Check that command line handling works consistently across all tests # -if [ -z "$top_builddir" ]; then - top_builddir="$(dirname $0)" +# top_builddir is not set during distcheck. Distcheck executes this +# script in the directory where the built binaries are so just use '.' +# as the directory if top_builddir is not set. + +tests_dir="$top_builddir" +if [ -z "$tests_dir" ]; then + tests_dir="." +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 -# allow to run this script from top directory -TESTLIST=`cat $top_builddir/test-list.txt` +TESTLIST=`cat $TESTLISTFILE` if [ $? -ne 0 ]; then - # distcheck requires this hack - TESTLIST=$(cat test-list.txt) - if [ $? -ne 0 ]; then - echo "Error: Could not read test lists" - exit 99 - fi + echo "Error: Could not read test lists" + exit 99 fi fail () { @@ -50,12 +59,16 @@ for test in $TESTLIST; do continue fi - # top_builddir is empty for distcheck - test=$top_builddir/$test - - # distcheck requires this hack - if [ ! -x "$test" ]; then - continue + testname="$test" + if [ -x "$tests_dir/$test" ]; then + test="$tests_dir/$test" + else + # Possibly a script, not found in builddir but in srcdir + if [ -x "$srcdir/$test" ]; then + test="$srcdir/$test" + else + fail "Cannot execute $test" + fi fi echo "$test:"