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 CAFBF6DE096A for ; Mon, 25 Sep 2017 13:39:02 -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.065 X-Spam-Level: X-Spam-Status: No, score=-0.065 tagged_above=-999 required=5 tests=[AWL=0.146, 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 sPUqEr1RLXF5 for ; Mon, 25 Sep 2017 13:39:01 -0700 (PDT) Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by arlo.cworth.org (Postfix) with ESMTPS id 8D9F26DE110A for ; Mon, 25 Sep 2017 13:38:59 -0700 (PDT) Received: by mail-wr0-f195.google.com with SMTP id g50so600081wra.3 for ; Mon, 25 Sep 2017 13:38:59 -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=b/qplzo8qOEe3luzqe6eh2r6YtaJHP86r9yjdACEXD4=; b=eZETJH77PrvwgadSfWebZiWYTMF4Dx1pmjMPDP2v3XYP/m+x9UwOfg/vYV/+SkO2iB u67L5oz53h+aUDbJI6Fp5Ijjij6/BuEsPPrsgeYMmak+Tu/G5NXyaK07Q9yZJ7m+QgiI kKVFQ2kOh9avx63ZtB9Ljz8YFCOLv+/JXEOeg4ayZDUjVOadOdNvhF9QfQ/mhh2GDIHR cmhrzcvdeQJPmgkL8/Fl3MaqpvKEICX0WrdOzbrPNyIshf8Cfi/xIf7hI++IyVhIjGyj fbAw521y1w/9C01zDsT8rBhCXnpMGHlzvGFFxrd8TvMlV5LTTQGSeUcl4b7PdQicXYzo iq8A== 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=b/qplzo8qOEe3luzqe6eh2r6YtaJHP86r9yjdACEXD4=; b=iByImaKoOEHpeWXiS/Y6YQs8OlIaJTBgLQ+C2liraYUIk+VgcJIc+7MywpUBuy8VtR 0oW52oAHJ1/wsB37CmVIJWURMxLpKJ7UN/FDHQX12c9fqudOk/sUkfcrLkbr0+PlpSXY VnQXPrNKOHpgDT60NUGQdQbQUHZaJkxa+89mUGucJB2xBPyCeAvl93U7bXTz8aOYOlh2 jmJR8SvhdqqwRukLSu7BUCqQLof62inGNFKvLpNpvNLQWNgbkvPZEbOYkFf+o2LOczXq nvfR9jtPi91uiZDN0NUU3FAEofspvEOp08n9PlF5Y0yf4LcYsvqnUyB/edmCFckeHgI/ Zh7w== X-Gm-Message-State: AHPjjUgztauDzjyqeG6BYUXf20CEqGbrc3eRqqeRlvkTAgKRiG0ah/07 mEc7j/dC+2Md8G2w5tM2+bZ1vQGOaO0= X-Google-Smtp-Source: AOwi7QA1SSxbYES2jRMsftsbAiRhRbPQABWOq7zf0HTQ33j1zTB8cU3VRbFyFsaqebmK5g+QlGvAWA== X-Received: by 10.46.83.87 with SMTP id t23mr3650794ljd.188.1506371936712; Mon, 25 Sep 2017 13:38:56 -0700 (PDT) Received: from localhost (mobile-access-5d6a60-234.dhcp.inet.fi. [93.106.96.234]) by smtp.gmail.com with ESMTPSA id q17sm1140340lfi.12.2017.09.25.13.38.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2017 13:38:55 -0700 (PDT) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH 07/24] test: use source and build paths in test-lib.sh Date: Mon, 25 Sep 2017 23:38:23 +0300 Message-Id: <58c77ca5b408c78fa042b93b77cb98581278b5bb.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:03 -0000 Make a distinction between source and build directories. --- test/test-lib.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index e3b40f21743d..5ccae7aea28b 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -26,9 +26,11 @@ fi # Make sure echo builtin does not expand backslash-escape sequences by default. shopt -u xpg_echo +# Ensure NOTMUCH_SRCDIR and NOTMUCH_BUILDDIR are set. +. $(dirname "$0")/export-dirs.sh || exit 1 + # It appears that people try to run tests without building... -if ! test -x ../notmuch -then +if [[ ! -x "$NOTMUCH_BUILDDIR/notmuch" ]]; then echo >&2 'You do not seem to have built notmuch yet.' exit 1 fi @@ -369,7 +371,7 @@ add_email_corpus () if [ -d $TEST_DIRECTORY/corpora.mail/$corpus ]; then cp -a $TEST_DIRECTORY/corpora.mail/$corpus ${MAIL_DIR} else - cp -a $TEST_DIRECTORY/corpora/$corpus ${MAIL_DIR} + cp -a $NOTMUCH_SRCDIR/test/corpora/$corpus ${MAIL_DIR} notmuch new >/dev/null || die "'notmuch new' failed while adding email corpus" mkdir -p $TEST_DIRECTORY/corpora.mail cp -a ${MAIL_DIR} $TEST_DIRECTORY/corpora.mail/$corpus @@ -918,8 +920,8 @@ export NOTMUCH_CONFIG=$NOTMUCH_CONFIG # --load Force loading of notmuch.el and test-lib.el exec ${TEST_EMACS} --quick \ - --directory "$TEST_DIRECTORY/../emacs" --load notmuch.el \ - --directory "$TEST_DIRECTORY" --load test-lib.el \ + --directory "$NOTMUCH_SRCDIR/emacs" --load notmuch.el \ + --directory "$NOTMUCH_SRCDIR/test" --load test-lib.el \ "\$@" EOF chmod a+x "$TMP_DIRECTORY/run_emacs" @@ -934,8 +936,8 @@ test_emacs () { test -z "$missing_dependencies" || return if [ -z "$EMACS_SERVER" ]; then - emacs_tests="${this_test_bare}.el" - if [ -f "$TEST_DIRECTORY/$emacs_tests" ]; then + emacs_tests="$NOTMUCH_SRCDIR/test/${this_test_bare}.el" + if [ -f "$emacs_tests" ]; then load_emacs_tests="--eval '(load \"$emacs_tests\")'" else load_emacs_tests= @@ -978,14 +980,14 @@ test_python() { } test_ruby() { - MAIL_DIR=$MAIL_DIR ruby -I $TEST_DIRECTORY/../bindings/ruby> OUTPUT + MAIL_DIR=$MAIL_DIR ruby -I $NOTMUCH_SRCDIR/bindings/ruby> OUTPUT } test_C () { exec_file="test${test_count}" test_file="${exec_file}.c" cat > ${test_file} - ${TEST_CC} ${TEST_CFLAGS} -I${TEST_DIRECTORY} -I${NOTMUCH_SRCDIR}/lib -o ${exec_file} ${test_file} -L${TEST_DIRECTORY}/../lib/ -lnotmuch -ltalloc + ${TEST_CC} ${TEST_CFLAGS} -I${NOTMUCH_SRCDIR}/test -I${NOTMUCH_SRCDIR}/lib -o ${exec_file} ${test_file} -L${NOTMUCH_BUILDDIR}/lib/ -lnotmuch -ltalloc echo "== stdout ==" > OUTPUT.stdout echo "== stderr ==" > OUTPUT.stderr ./${exec_file} "$@" 1>>OUTPUT.stdout 2>>OUTPUT.stderr @@ -1041,7 +1043,7 @@ test_init_ () { } -. ./test-lib-common.sh || exit 1 +. "$NOTMUCH_SRCDIR/test/test-lib-common.sh" || exit 1 if [ "${NOTMUCH_GMIME_MAJOR}" = 3 ]; then test_subtest_broken_gmime_3 () { -- 2.11.0