From patchwork Fri Apr 29 13:11:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marius Vlad X-Patchwork-Id: 8981981 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 45E53BF29F for ; Fri, 29 Apr 2016 13:08:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2732E201C0 for ; Fri, 29 Apr 2016 13:08:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5753F200D9 for ; Fri, 29 Apr 2016 13:08:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E198D6EEF7; Fri, 29 Apr 2016 13:08:15 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 8E4BF6EF21 for ; Fri, 29 Apr 2016 13:08:13 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 29 Apr 2016 06:08:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,551,1455004800"; d="scan'208";a="694292141" Received: from mcvlad-wk.rb.intel.com ([10.237.105.57]) by FMSMGA003.fm.intel.com with ESMTP; 29 Apr 2016 06:08:12 -0700 From: Marius Vlad To: intel-gfx@lists.freedesktop.org Date: Fri, 29 Apr 2016 16:11:19 +0300 Message-Id: <1461935480-31688-1-git-send-email-marius.c.vlad@intel.com> X-Mailer: git-send-email 2.8.0.rc3 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t 1/2] autotools: Check target requires to a have the list of tests built. 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We need to have the test list generated before running the check target. Migrated igt_command_line.sh to tests/ from lib/tests/, which allows to building the tests and execute the script. This would allow cleaning followed by a make check. Signed-off-by: Marius Vlad Reviewed-by: Chris Wilson --- lib/tests/Makefile.am | 1 - lib/tests/Makefile.sources | 3 -- lib/tests/igt_command_line.sh | 76 ------------------------------------------- tests/Makefile.am | 2 +- tests/Makefile.sources | 8 +++++ tests/igt_command_line.sh | 74 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 83 insertions(+), 81 deletions(-) delete mode 100755 lib/tests/igt_command_line.sh create mode 100755 tests/igt_command_line.sh diff --git a/lib/tests/Makefile.am b/lib/tests/Makefile.am index 582cc3e..99ab724 100644 --- a/lib/tests/Makefile.am +++ b/lib/tests/Makefile.am @@ -4,7 +4,6 @@ AM_TESTS_ENVIRONMENT = \ top_builddir=$(top_builddir) \ top_srcdir=$(top_srcdir) -EXTRA_DIST = $(check_SCRIPTS) AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS) \ -I$(srcdir)/../.. \ diff --git a/lib/tests/Makefile.sources b/lib/tests/Makefile.sources index 707c445..37126f1 100644 --- a/lib/tests/Makefile.sources +++ b/lib/tests/Makefile.sources @@ -15,9 +15,6 @@ check_PROGRAMS = \ igt_exit_handler \ $(NULL) -check_SCRIPTS = \ - igt_command_line.sh \ - $(NULL) TESTS = \ $(check_PROGRAMS) \ diff --git a/lib/tests/igt_command_line.sh b/lib/tests/igt_command_line.sh deleted file mode 100755 index e83a548..0000000 --- a/lib/tests/igt_command_line.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/sh -# -# Copyright © 2014 Intel Corporation -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. - -# -# Check that command line handling works consistently across all tests -# - -TESTLIST=`cat $top_builddir/tests/test-list.txt` -if [ $? -ne 0 ]; then - echo "Error: Could not read test lists" - exit 99 -fi - -for test in $TESTLIST; do - - if [ "$test" = "TESTLIST" -o "$test" = "END" ]; then - continue - fi - - if [ -x $top_builddir/tests/$test ]; then - test=$top_builddir/tests/$test - else - # if the test is a script, it will be in $srcdir - test=$top_srcdir/tests/$test - fi - - echo "$test:" - - # check invalid option handling - echo " Checking invalid option handling..." - ./$test --invalid-option 2> /dev/null && exit 1 - - # check valid options succeed - echo " Checking valid option handling..." - ./$test --help > /dev/null || exit 1 - - # check --list-subtests works correctly - echo " Checking subtest enumeration..." - LIST=`./$test --list-subtests` - RET=$? - if [ $RET -ne 0 -a $RET -ne 79 ]; then - exit 1 - fi - - if [ $RET -eq 79 -a -n "$LIST" ]; then - exit 1 - fi - - if [ $RET -eq 0 -a -z "$LIST" ]; then - exit 1 - fi - - # check invalid subtest handling - echo " Checking invalid subtest handling..." - ./$test --run-subtest invalid-subtest > /dev/null 2>&1 && exit 1 -done diff --git a/tests/Makefile.am b/tests/Makefile.am index 45e3359..79a7324 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -49,7 +49,7 @@ all-local: .gitignore pkgdata_DATA = test-list.txt test-list-full.txt EXTRA_PROGRAMS = $(HANG) -EXTRA_DIST = $(common_files) +EXTRA_DIST = $(common_files) $(check_SCRIPTS) CLEANFILES = $(EXTRA_PROGRAMS) test-list.txt test-list-full.txt .gitignore diff --git a/tests/Makefile.sources b/tests/Makefile.sources index b73f48d..28e8695 100644 --- a/tests/Makefile.sources +++ b/tests/Makefile.sources @@ -287,6 +287,14 @@ testdisplay_SOURCES = \ TESTS_progs += testdisplay +check_SCRIPTS = \ + igt_command_line.sh \ + $(NULL) + +TESTS = \ + $(check_SCRIPTS) \ + $(NULL) + common_files = \ eviction_common.c \ $(NULL) diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh new file mode 100755 index 0000000..fd09981 --- /dev/null +++ b/tests/igt_command_line.sh @@ -0,0 +1,74 @@ +#!/bin/sh +# +# Copyright © 2014 Intel Corporation +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +# +# Check that command line handling works consistently across all tests +# + +TESTLIST=`cat test-list.txt` +if [ $? -ne 0 ]; then + echo "Error: Could not read test lists" + exit 99 +fi + +for test in $TESTLIST; do + + if [ "$test" = "TESTLIST" -o "$test" = "END" ]; then + continue + fi + + # make distcheck happy + if [ ! -x "$test" ]; then + continue + fi + + echo "$test:" + + # check invalid option handling + echo " Checking invalid option handling..." + ./$test --invalid-option 2> /dev/null && exit 1 + + # check valid options succeed + echo " Checking valid option handling..." + ./$test --help > /dev/null || exit 1 + + # check --list-subtests works correctly + echo " Checking subtest enumeration..." + LIST=`./$test --list-subtests` + RET=$? + if [ $RET -ne 0 -a $RET -ne 79 ]; then + exit 1 + fi + + if [ $RET -eq 79 -a -n "$LIST" ]; then + exit 1 + fi + + if [ $RET -eq 0 -a -z "$LIST" ]; then + exit 1 + fi + + # check invalid subtest handling + echo " Checking invalid subtest handling..." + ./$test --run-subtest invalid-subtest > /dev/null 2>&1 && exit 1 +done