From 1ddd33fc9e4ec625921aff7087cd15784175e660 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Fri, 15 Apr 2016 19:46:40 +0300 Subject: [PATCH] [PATCH] test: set LD_LIBRARY_PATH early and keep its old contents --- 62/9262c1c8431ee769c7ee555cc850f780ed6669 | 132 ++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 62/9262c1c8431ee769c7ee555cc850f780ed6669 diff --git a/62/9262c1c8431ee769c7ee555cc850f780ed6669 b/62/9262c1c8431ee769c7ee555cc850f780ed6669 new file mode 100644 index 000000000..d4b2a888b --- /dev/null +++ b/62/9262c1c8431ee769c7ee555cc850f780ed6669 @@ -0,0 +1,132 @@ +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 326E06DE00F5 + for ; Fri, 15 Apr 2016 09:46:54 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.281 +X-Spam-Level: +X-Spam-Status: No, score=0.281 tagged_above=-999 required=5 tests=[AWL=0.290, + HEADER_FROM_DIFFERENT_DOMAINS=0.001, T_RP_MATCHES_RCVD=-0.01] + 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 rUIQcvd8e_2d for ; + Fri, 15 Apr 2016 09:46:46 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by arlo.cworth.org (Postfix) with ESMTP id 303E06DE00EB + for ; Fri, 15 Apr 2016 09:46:46 -0700 (PDT) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id ACF5F10019D; Fri, 15 Apr 2016 19:46:42 +0300 (EEST) +From: Tomi Ollila +To: notmuch@notmuchmail.org +Cc: tomi.ollila@iki.fi +Subject: [PATCH] test: set LD_LIBRARY_PATH early and keep its old contents +Date: Fri, 15 Apr 2016 19:46:40 +0300 +Message-Id: <1460738800-9021-1-git-send-email-tomi.ollila@iki.fi> +X-Mailer: git-send-email 2.6.4 +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: Fri, 15 Apr 2016 16:46:54 -0000 + +Previously LD_LIBRARY_PATH was set 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. In some systems the old contents of +LD_LIBRARY_PATH was needed to e.g. locate suitable gmime library. +--- + +These changes scratch the particular itch I have with these when +running this on Scientific Linux 6.2. Before this I got quite a +few lines of noise, and notmuch printing empty strings breaking +the test suite even more. Now I get + +Notmuch test suite complete. +765/768 tests passed. +1 broken test failed as expected. +2 tests failed. + +Which is pretty good. Those 2 failing tests (and some skipped) +is just "normal" in this system. + + 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 0cdd36a74655..f5eca50066bc 100644 +--- a/test/test-lib-common.sh ++++ b/test/test-lib-common.sh +@@ -58,6 +58,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 235149b7b837..e8003237b24d 100644 +--- a/test/test-lib.sh ++++ b/test/test-lib.sh +@@ -1175,7 +1175,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) \ +@@ -1183,7 +1182,6 @@ test_python() { + } + + test_ruby() { +- export LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib + MAIL_DIR=$MAIL_DIR ruby -I $TEST_DIRECTORY/../bindings/ruby> OUTPUT + } + +@@ -1191,7 +1189,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.6.4 + -- 2.26.2