From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asUgW-00005i-1n for qemu-devel@nongnu.org; Tue, 19 Apr 2016 08:23:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asUgR-00069h-SJ for qemu-devel@nongnu.org; Tue, 19 Apr 2016 08:23:15 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:37610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asUgR-00069K-Io for qemu-devel@nongnu.org; Tue, 19 Apr 2016 08:23:11 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 19 Apr 2016 13:23:09 +0100 From: Sascha Silbe In-Reply-To: <57101588.3080204@redhat.com> References: <1460633543-7366-1-git-send-email-silbe@linux.vnet.ibm.com> <57101588.3080204@redhat.com> Date: Tue, 19 Apr 2016 14:22:43 +0200 Message-ID: <87fuuh7ppo.fsf@oc4731375738.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-2.6?] qemu-iotests: iotests: fail hard if not run via "check" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org, qemu-block@nongnu.org Cc: Kevin Wolf Dear Max, Max Reitz writes: > On 14.04.2016 13:32, Sascha Silbe wrote: [tests/qemu-iotests/iotests.py] [...] >> def main(supported_fmts=3D[], supported_oses=3D['linux']): >> '''Run tests''' >>=20=20 >> + if test_dir is None or qemu_default_machine is None: > > I think checking test_dir would have been sufficient; this makes it look > like it might want to be a complete list of variables that have to be > set, but then "cachemode" is missing. Markus Armbruster basically pointed out the same issue, so how about this version: # We are using TEST_DIR and QEMU_DEFAULT_MACHINE as proxies to # indicate that we're not being run via "check". There may be # other things set up by "check" that individual test cases rely # on. if test_dir is None or qemu_default_machine is None: sys.stderr.write('Please run this test via the "check" script\n') sys.exit(os.EX_USAGE) >> + sys.stderr.write('Please run this test via ./check\n') > > Or not ./, for people who have separate build and source trees, you > don't want to invoke check in the source tree. ;-) Yeah, was thinking about that, but ultimately considered ./check to be the best indication of a) "check" being the name of a script and b) residing in the same directory as the test. But I don't care much about this, so see the above version. Sascha --=20 Softwareentwicklung Sascha Silbe, Niederhofenstra=C3=9Fe 5/1, 71229 Leonberg https://se-silbe.de/ USt-IdNr. DE281696641