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 30E176DE1310 for ; Mon, 25 Sep 2017 13:39:23 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Spam-Flag: NO X-Spam-Score: -0.069 X-Spam-Level: X-Spam-Status: No, score=-0.069 tagged_above=-999 required=5 tests=[AWL=0.142, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.211] 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 gZKo2xnzoJES for ; Mon, 25 Sep 2017 13:39:21 -0700 (PDT) Received: from mail-wr0-f177.google.com (mail-wr0-f177.google.com [209.85.128.177]) by arlo.cworth.org (Postfix) with ESMTPS id 48ECE6DE1155 for ; Mon, 25 Sep 2017 13:39:06 -0700 (PDT) Received: by mail-wr0-f177.google.com with SMTP id l39so9980226wrl.12 for ; Mon, 25 Sep 2017 13:39:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nikula-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=Qbw0IrQr4VdmhKEgGlB3z3TnD9gypBMXX+plDCvJvC8=; b=kb9RKAF0olwCcjaKm20Lg7ENkWUsxtAHd7FFl0d7D3F+c/6RU46nSduHjzUvgci0qO UHrdqVurVJVztmsswC5Or0y+xw5Aj4/qsoKrtlS6yjHR9TMN6bQJ9GKYm+vmHO3ghvsD f93P9ck157jUyG5gWRBvwtANdVjVtnEXXR/daCgwk4Bcvf4iRmP8jCT7segXB1Za7Ewh FTMuhnINcRnQQIb+b8EtNY9oT//TN8FhZW72fOcdBH+zK4BKTdRRkwy2zRa6NCj+K3x1 HKDJtIwFWLk4DJwLGfdd1lWQFH6A1bqQmE7hPqFNKp0vAKkGkuM2ydUoUauoyYBuZ0hK vAfg== 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:in-reply-to:references; bh=Qbw0IrQr4VdmhKEgGlB3z3TnD9gypBMXX+plDCvJvC8=; b=jSfUroZfHZRfSGuwvke4rRdVd22YNvNMYKDuTdySJSNOFwX8kWa5dQhXqjWgqy0opp a6/Cozwvl8PhiY+5ToYAXDrzC8APiITujzKBwrknFP98Ksaho8aIFBns7hA4eaVQX94M SWlXbdjM5WY8vt/PMITveYZGNI9fizGbaQZHQeEfTA2k/7r7p/mwyXGxzjLTAZKWZGpv oIO4P5n6718KV2KQ1dTrod3z1h++aQQ9Jh15Z30LjXlun81BALmBzXQI+p7ivXb1lv1E 0jWbcJzJ2kMdqDwoAxzDmPg4EL5wJQcnCexseomm1ZQgHWc5r1QQA+nrOV2bkDBoEOG0 wRZA== X-Gm-Message-State: AHPjjUgRjAPg9sbkN3hGIUJGFJc3YcK1+oTmidF223goRsQiL0A1A7XH 4ekALBtd8sWt4f9DMDp5wv3i1st8l7w= X-Google-Smtp-Source: AOwi7QDNDbS72SI/HA1VutE9UgxYARgLOsTwbDvL9jwN2rINWEDeP88j0JGhDHSuoT7V/L+N92byog== X-Received: by 10.25.196.213 with SMTP id u204mr2172095lff.99.1506371943369; Mon, 25 Sep 2017 13:39:03 -0700 (PDT) Received: from localhost (mobile-access-5d6a60-234.dhcp.inet.fi. [93.106.96.234]) by smtp.gmail.com with ESMTPSA id z86sm1596231ljb.75.2017.09.25.13.39.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2017 13:39:02 -0700 (PDT) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH 11/24] test: use source and build paths in notmuch-test Date: Mon, 25 Sep 2017 23:38:27 +0300 Message-Id: <869ceffff690099d23b3adceadc21d7ce0e2350a.1506370901.git.jani@nikula.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 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, 25 Sep 2017 20:39:23 -0000 Make a distinction between source and build directories. --- test/notmuch-test | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/test/notmuch-test b/test/notmuch-test index 9d9df7dfedbe..ca68dd416cfc 100755 --- a/test/notmuch-test +++ b/test/notmuch-test @@ -15,12 +15,20 @@ if [ ${BASH_VERSINFO[0]} -lt 4 ]; then exit 1 fi -cd "$(dirname "$0")" +# Ensure NOTMUCH_SRCDIR and NOTMUCH_BUILDDIR are set. +. $(dirname "$0")/export-dirs.sh || exit 1 -TESTS=${NOTMUCH_TESTS:-T[0-9][0-9][0-9]-*.sh} +TESTS= +for test in $NOTMUCH_TESTS; do + TESTS="$TESTS $NOTMUCH_SRCDIR/test/$test" +done + +if [[ -z "$TESTS" ]]; then + TESTS="$NOTMUCH_SRCDIR/test/T[0-9][0-9][0-9]-*.sh" +fi # Clean up any results from a previous run -rm -rf test-results +rm -rf $NOTMUCH_BUILDDIR/test/test-results # Test for timeout utility if command -v timeout >/dev/null; then @@ -33,12 +41,13 @@ fi trap 'e=$?; kill $!; exit $e' HUP INT TERM # Run the tests for test in $TESTS; do - $TEST_TIMEOUT_CMD ./$test "$@" & + $TEST_TIMEOUT_CMD $test "$@" & wait $! # If the test failed without producing results, then it aborted, # so we should abort, too. RES=$? - if [[ $RES != 0 && ! -e "test-results/${test%.sh}" ]]; then + testname=$(basename $test .sh) + if [[ $RES != 0 && ! -e "$NOTMUCH_BUILDDIR/test/test-results/$testname" ]]; then exit $RES fi done @@ -46,10 +55,10 @@ trap - HUP INT TERM # Report results echo -./aggregate-results.sh test-results/* +$NOTMUCH_SRCDIR/test/aggregate-results.sh $NOTMUCH_BUILDDIR/test/test-results/* ev=$? # Clean up -rm -rf test-results corpora.mail +rm -rf $NOTMUCH_BUILDDIR/test/test-results $NOTMUCH_BUILDDIR/test/corpora.mail exit $ev -- 2.11.0