From 036033d3484b7b97865eef9dcca79e724f2f4b80 Mon Sep 17 00:00:00 2001 From: Bijan Chokoufe Nejad Date: Thu, 26 May 2016 18:03:07 +0200 Subject: [PATCH] Re: [PATCH 1/2] test: set LD_LIBRARY_PATH early and keep its old contents --- 91/e0f4f7b1028eb1caf62911666142e166b5b322 | 171 ++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 91/e0f4f7b1028eb1caf62911666142e166b5b322 diff --git a/91/e0f4f7b1028eb1caf62911666142e166b5b322 b/91/e0f4f7b1028eb1caf62911666142e166b5b322 new file mode 100644 index 000000000..3e927399e --- /dev/null +++ b/91/e0f4f7b1028eb1caf62911666142e166b5b322 @@ -0,0 +1,171 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 9BB2B6DE00DF + for ; Thu, 26 May 2016 09:03:20 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.82 +X-Spam-Level: +X-Spam-Status: No, score=-0.82 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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 3DE4ZoJOJurJ for ; + Thu, 26 May 2016 09:03:11 -0700 (PDT) +Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com + [74.125.82.50]) by arlo.cworth.org (Postfix) with ESMTPS id 85AA46DE009B for + ; Thu, 26 May 2016 09:03:11 -0700 (PDT) +Received: by mail-wm0-f50.google.com with SMTP id n129so105672685wmn.1 + for ; Thu, 26 May 2016 09:03:11 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=date:from:to:cc:subject:message-id:references:mime-version + :content-disposition:in-reply-to:user-agent; + bh=2K+j5kF6Ex6SjNbtJcUdvDt+6HSzIJ6lW/M5wUbufK8=; + b=gS0SIbbrPSZ2+l8A1onIlJV/zZJG9guM1CkVWU5CqzTmrsksCT6GVOiXt0B4MQr8KJ + rzRhZoEetbL3YRPhgvSV7eboCRg2U/wEIWAGPe3OK9THcDaq2+ahziarJbIbPZ+Vsu7u + U2/LvrILelsSpYtUecZoMpN/1vrPrXje2dDno3yGA7muF/bjIwV4jPILNovEL9CHr7DC + fQnKwwQnZ0PDjiXzr4nazjn+yqJ0TMYyRpREhLjYmCfJsklmh1FNAx0X2iqloPdiBB2e + twX5i+sR2OI2OFIfbEke21CLMA1mbPn+CdPNUN6g77aH70THdu0TUzRWMOBoIEd6c7X7 + mZOw== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:date:from:to:cc:subject:message-id:references + :mime-version:content-disposition:in-reply-to:user-agent; + bh=2K+j5kF6Ex6SjNbtJcUdvDt+6HSzIJ6lW/M5wUbufK8=; + b=KRrh/QcMsGlNULpXhlX6UIxkquulLKdRy3SgUU23I9SEdHA1tIvrqAANFY1NG627m2 + eS3E5HAhosZJT2kH6e+v39FqZuTrm7kTWVmQm58aUW7HdzroEqx+qxAzH0lRTnlRoxD5 + DN0JKmM6H6lsSBmbvH3ZgGtzSbMGSVQkHmtgRxY71yfMDy805dOREdaH9XaIyU/oOzOX + W5l4H67M26nFrdLmIN55GoRS8PvQxm4xIL44wGqYwD3I8bRjHQJahknMnu9ecpphNw5/ + MDB006u8AJBhMgr1Z6iOQyYXI8p+o+Wa3QxH1pd73KOOc8SnmLTAPC36CwKL082+NwDL + pcTg== +X-Gm-Message-State: + ALyK8tLKhHYZzGIEK+UbGFjWu9RPAUidGzWhNW3tXbKPbNvbxld5QAuMGT1MHZYiQrc2vQ== +X-Received: by 10.194.201.97 with SMTP id jz1mr10015543wjc.44.1464278589000; + Thu, 26 May 2016 09:03:09 -0700 (PDT) +Received: from localhost (chokoufe.desy.de. [131.169.210.242]) + by smtp.gmail.com with ESMTPSA id o203sm4175415wmg.22.2016.05.26.09.03.07 + (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Thu, 26 May 2016 09:03:08 -0700 (PDT) +Date: Thu, 26 May 2016 18:03:07 +0200 +From: Bijan Chokoufe Nejad +To: Tomi Ollila +Cc: notmuch@notmuchmail.org +Subject: Re: [PATCH 1/2] test: set LD_LIBRARY_PATH early and keep its old + contents +Message-ID: <20160526160307.GC30031@bijan-TPX1Yoga> +References: <1464212261-26892-1-git-send-email-tomi.ollila@iki.fi> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <1464212261-26892-1-git-send-email-tomi.ollila@iki.fi> +User-Agent: Mutt/1.5.24 (2015-08-30) +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +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: Thu, 26 May 2016 16:03:20 -0000 + +This could explain some of the problems I had to get the test suite running. +I would have never guessed that LD_LIBRARY_PATH gets overwritten by the test +suite. + +On 16-05-26, Tomi Ollila wrote: +> Previously LD_LIBRARY_PATH was exported (and environment changed) +> in the middle of test case execution, when a function setting it +> was called. +> +> Previously the old contents of LD_LIBRARY_PATH was lost (if any) +> when it was re-set and exported. In some systems the old contents of +> LD_LIBRARY_PATH was needed to e.g. locate suitable gmime library. +> --- +> +> This series (of 2 patches) has exactly same payload as the previous +> version: +> id:1460738800-9021-1-git-send-email-tomi.ollila@iki.fi +> +> commit messages are updated to be accurate (? :) this time. +> +> test/T360-symbol-hiding.sh | 5 ++--- +> test/test-lib-common.sh | 5 +++++ +> test/test-lib.sh | 3 --- +> 3 files changed, 7 insertions(+), 6 deletions(-) +> +> diff --git a/test/T360-symbol-hiding.sh b/test/T360-symbol-hiding.sh +> index 3f18ec1a34fc..9c10e8eda07f 100755 +> --- a/test/T360-symbol-hiding.sh +> +++ b/test/T360-symbol-hiding.sh +> @@ -13,9 +13,8 @@ test_description='exception symbol hiding' +> +> test_begin_subtest 'running test' run_test +> mkdir -p ${PWD}/fakedb/.notmuch +> -( LD_LIBRARY_PATH="$TEST_DIRECTORY/../lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \ +> - $TEST_DIRECTORY/symbol-test ${PWD}/fakedb ${PWD}/nonexistent \ +> - 2>&1 | notmuch_dir_sanitize | sed -e "s,\`,\',g" -e "s,${NOTMUCH_DEFAULT_XAPIAN_BACKEND},backend,g") > OUTPUT +> +$TEST_DIRECTORY/symbol-test ${PWD}/fakedb ${PWD}/nonexistent 2>&1 \ +> + | notmuch_dir_sanitize | sed -e "s,\`,\',g" -e "s,${NOTMUCH_DEFAULT_XAPIAN_BACKEND},backend,g" > OUTPUT +> +> cat < EXPECTED +> A Xapian exception occurred opening database: Couldn't stat 'CWD/fakedb/.notmuch/xapian' +> diff --git a/test/test-lib-common.sh b/test/test-lib-common.sh +> index ba4a8e112084..026440ccc057 100644 +> --- a/test/test-lib-common.sh +> +++ b/test/test-lib-common.sh +> @@ -52,6 +52,11 @@ restore_database () { +> TEST_DIRECTORY=$(pwd -P) +> notmuch_path=`find_notmuch_path "$TEST_DIRECTORY"` +> +> +# Prepend $TEST_DIRECTORY/../lib to LD_LIBRARY_PATH, to make tests work +> +# on systems where ../notmuch depends on LD_LIBRARY_PATH. +> +LD_LIBRARY_PATH=${TEST_DIRECTORY%/*}/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} +> +export LD_LIBRARY_PATH +> + +> # configure output +> . $notmuch_path/sh.config || exit 1 +> +> diff --git a/test/test-lib.sh b/test/test-lib.sh +> index 62e123d65aba..a7e6397c324e 100644 +> --- a/test/test-lib.sh +> +++ b/test/test-lib.sh +> @@ -1171,7 +1171,6 @@ test_emacs () { +> } +> +> test_python() { +> - export LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib +> export PYTHONPATH=$TEST_DIRECTORY/../bindings/python +> +> (echo "import sys; _orig_stdout=sys.stdout; sys.stdout=open('OUTPUT', 'w')"; cat) \ +> @@ -1179,7 +1178,6 @@ test_python() { +> } +> +> test_ruby() { +> - export LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib +> MAIL_DIR=$MAIL_DIR ruby -I $TEST_DIRECTORY/../bindings/ruby> OUTPUT +> } +> +> @@ -1187,7 +1185,6 @@ test_C () { +> exec_file="test${test_count}" +> test_file="${exec_file}.c" +> cat > ${test_file} +> - export LD_LIBRARY_PATH=${TEST_DIRECTORY}/../lib +> ${TEST_CC} ${TEST_CFLAGS} -I${TEST_DIRECTORY}/../lib -o ${exec_file} ${test_file} -L${TEST_DIRECTORY}/../lib/ -lnotmuch -ltalloc +> echo "== stdout ==" > OUTPUT.stdout +> echo "== stderr ==" > OUTPUT.stderr +> -- +> 2.8.2 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> https://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2