Re: [PATCH 1/2] test: set LD_LIBRARY_PATH early and keep its old contents
authorBijan Chokoufe Nejad <bijan.chokoufe@gmail.com>
Thu, 26 May 2016 16:03:07 +0000 (18:03 +0200)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:21:54 +0000 (16:21 -0700)
91/e0f4f7b1028eb1caf62911666142e166b5b322 [new file with mode: 0644]

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