From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 27F376DE3306 for ; Mon, 26 Mar 2018 13:55:09 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.168 X-Spam-Level: X-Spam-Status: No, score=0.168 tagged_above=-999 required=5 tests=[AWL=-0.062, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tS8i-ScQSLEs for ; Mon, 26 Mar 2018 13:55:08 -0700 (PDT) Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by arlo.cworth.org (Postfix) with ESMTPS id 3A4366DE3305 for ; Mon, 26 Mar 2018 13:55:08 -0700 (PDT) Received: by mail-wm0-f49.google.com with SMTP id f125so17857893wme.4 for ; Mon, 26 Mar 2018 13:55:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=4NrHtB+BuhE57NbcwqTB/XmH39WIjlNJ1ywfE+6kVuQ=; b=KduKBbfLXr1U5oIYrd5WhLRYENlT3qNyWiwqHwLxH9hu1dxVEdWtiYorOq5rLRC5uR QG1zFiCLWHvYFKtHGiUikTKLTtvO30dfB65UzjWHbCZMgv4przHG1rweQHOu8Ef60Nnh sVkgZuqlsKfSO1lUP3o8jA9HqKExwI20tWHs0qe7FmW0HCWqYB4n/DYLvynVErEuOnPE 65JPRszR0wtSged7bm+mSBd9H9NZbNNoKn64icRKP1AeQ77NvLAIZY8MsRf5vGTPDlod q6qW+DFIpsgfGZpAKOb2OtGncZbVVAmFCdUjDC1teQn4VJQO6/O75UmBfw8jaAweSPd0 HrTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :date:message-id:mime-version; bh=4NrHtB+BuhE57NbcwqTB/XmH39WIjlNJ1ywfE+6kVuQ=; b=aKBDyxHMTCYs/ZM5y/T2Qi85cOcY+/1ApDDjS33OkZhAWXq9HqA63p3N1h4n8vnHSe gBzyBXGZKv9SSFA4/2R8wuBoXSsE16cMkV+SBB1Dm2jWEPwLCaH3xRnO4NwPws8CvDvB XUHvv8a5YWrS/qkzhuifKSFu0l20mcqtNBlYRn848E6QL4iacem5dnxiBxVgikroiapx aErEDPqDUF1tGJSXGm4NhaS3n3yDNlt5pWks7TOsx9P4ANOfN5Mlnb62eETFR1LMHG3S lronbVdQraAjaFbre7vsdjCaV3MEveqHvrgoRpOeQLpy1ZTDQwbI+roJlJyj3g7W7ohF u4UQ== X-Gm-Message-State: AElRT7Gd/UObNxkWshJyjMB/DCl3vyoI4EijSmSfVv+D95wg2ZXvgvZt LuSAygaTez6iGi6ezglBGyX0aBvd X-Google-Smtp-Source: AG47ELtiB2dL3bCIeuZkndy0X0BEYwfYMy9wBnbKSyc7+QGxof8CVNeZb5tQVkGJoCYy/dRf1R3ysA== X-Received: by 10.80.214.26 with SMTP id x26mr21796724edi.195.1522097706894; Mon, 26 Mar 2018 13:55:06 -0700 (PDT) Received: from devork.be ([2a02:168:581b::b89]) by smtp.gmail.com with ESMTPSA id i48sm10631108ede.39.2018.03.26.13.55.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Mar 2018 13:55:06 -0700 (PDT) Sender: Floris Bruynooghe Received: (nullmailer pid 198637 invoked by uid 469025); Mon, 26 Mar 2018 20:55:05 -0000 From: Floris Bruynooghe To: David Bremner , Justus Winter , David Bremner , "W. Trevor King" Cc: notmuch@notmuchmail.org Subject: Re: [PATCH 1/3] configure: check for pytest binary In-Reply-To: <20180325174034.17912-2-david@tethera.net> References: <87po3x4tuc.fsf@thinkbox.jade-hamburg.de> <20180325174034.17912-1-david@tethera.net> <20180325174034.17912-2-david@tethera.net> Date: Mon, 26 Mar 2018 22:55:05 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 20:55:09 -0000 On Sun, Mar 25 2018, David Bremner wrote: > This is to support future use of pytest in the test suite Thanks for having a go at this! > --- > configure | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/configure b/configure > index b177b141..ab45878d 100755 > --- a/configure > +++ b/configure > @@ -62,6 +62,7 @@ CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)} > LDFLAGS=${LDFLAGS:-} > XAPIAN_CONFIG=${XAPIAN_CONFIG:-} > PYTHON=${PYTHON:-} > +PYTEST=${PYTEST:-} > > # We don't allow the EMACS or GZIP Makefile variables inherit values > # from the environment as we do with CC and CXX above. The reason is > @@ -118,6 +119,8 @@ Other environment variables can be used to control configure itself, > library. [$XAPIAN_CONFIG] > PYTHON Name of python command to use in > configure and the test suite. > + PYTEST Name of pytest command to use in > + the test suite. > > Additionally, various options can be specified on the configure > command line. > @@ -571,6 +574,24 @@ if [ $have_python -eq 0 ]; then > errors=$((errors + 1)) > fi > > +pytest="" > +if [ $have_python -eq 1 ]; then > + printf "Checking for pytest... " > + have_pytest=0 > + > + for name in ${PYTEST} pytest-3 pytest pytest-2; do This is kind of not granular enough I think. It would be better to invoke pytest as "pythonX.Y -m pytest" which is the safe way to execute it on all python versions. > + if command -v $name > /dev/null; then > + have_pytest=1 > + pytest=$name > + printf "Yes (%s).\n" $pytest > + break > + fi > + done > + if [ $have_pytest -eq 0 ]; then > + printf "No (some tests may be skipped).\n" > + fi The other thing I was trying to achieve was to be able to run the unittest for each python version, so say 2.7, 3.5 & 3.6 are supported then I was trying to find all of those instead of just one.