[PATCH 1/2] test/symbol-hiding: rename to test/libnotmuch-abi, prepare to add more...
authordavid <david@tethera.net>
Wed, 29 Jun 2011 11:56:34 +0000 (08:56 +2100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:49 +0000 (09:38 -0800)
43/1b3c473d6ee89adcb21149927a852ad9ea07b0 [new file with mode: 0644]

diff --git a/43/1b3c473d6ee89adcb21149927a852ad9ea07b0 b/43/1b3c473d6ee89adcb21149927a852ad9ea07b0
new file mode 100644 (file)
index 0000000..97d528f
--- /dev/null
@@ -0,0 +1,215 @@
+Return-Path: <bremner@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 037D8429E5F\r
+       for <notmuch@notmuchmail.org>; Wed, 29 Jun 2011 04:56:51 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id PNb+nAlOA+ho for <notmuch@notmuchmail.org>;\r
+       Wed, 29 Jun 2011 04:56:50 -0700 (PDT)\r
+Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 11912429E5B\r
+       for <notmuch@notmuchmail.org>; Wed, 29 Jun 2011 04:56:49 -0700 (PDT)\r
+Received: from zancas.localnet\r
+       (fctnnbsc30w-142167176081.pppoe-dynamic.High-Speed.nb.bellaliant.net\r
+       [142.167.176.81]) (authenticated bits=0)\r
+       by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id p5TBuiL3028217\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);\r
+       Wed, 29 Jun 2011 08:56:45 -0300\r
+Received: from bremner by zancas.localnet with local (Exim 4.76)\r
+       (envelope-from <bremner@tethera.net>)\r
+       id 1QbtNs-00055P-GZ; Wed, 29 Jun 2011 08:56:44 -0300\r
+From: david@tethera.net\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/2] test/symbol-hiding: rename to test/libnotmuch-abi,\r
+       prepare to add more subtests\r
+Date: Wed, 29 Jun 2011 08:56:34 -0300\r
+Message-Id: <1309348595-19503-1-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.7.5.4\r
+Cc: David Bremner <bremner@debian.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 29 Jun 2011 11:56:51 -0000\r
+\r
+From: David Bremner <bremner@debian.org>\r
+\r
+Test descriptions changed to accomodate more subtests.\r
+The generic 'run_test' is renamed 'run_exception_test',\r
+symbol-test(.cc) is renamed exception-test(.cc).\r
+---\r
+\r
+I'm not sure if it would be better to start a new test script rather\r
+than this fuss about renaming, but "symbol-test.cc" is probably to\r
+generic as a name anyway. Arguably exception-test.cc is pretty generic\r
+too.\r
+\r
+ test/basic             |    2 +-\r
+ test/exception-test.cc |   17 +++++++++++++++++\r
+ test/libnotmuch-abi    |   26 ++++++++++++++++++++++++++\r
+ test/notmuch-test      |    2 +-\r
+ test/symbol-hiding     |   26 --------------------------\r
+ test/symbol-test.cc    |   17 -----------------\r
+ 6 files changed, 45 insertions(+), 45 deletions(-)\r
+ create mode 100644 test/exception-test.cc\r
+ create mode 100755 test/libnotmuch-abi\r
+ delete mode 100755 test/symbol-hiding\r
+ delete mode 100644 test/symbol-test.cc\r
+\r
+diff --git a/test/basic b/test/basic\r
+index 33bf711..9b8542f 100755\r
+--- a/test/basic\r
++++ b/test/basic\r
+@@ -56,7 +56,7 @@ tests_in_suite=$(for i in $TESTS; do echo $i; done | sort)\r
+ available=$(ls -1 $TEST_DIRECTORY/ | \\r
+     sed -r -e "/^(aggregate-results.sh|Makefile|Makefile.local|notmuch-test)/d" \\r
+          -e "/^(README|test-lib.sh|test-lib.el|test-results|tmp.*|valgrind|corpus*)/d" \\r
+-         -e "/^(emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose|symbol-test.cc)/d" \\r
++         -e "/^(emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose|exception-test.cc)/d" \\r
+          -e "/^(test.expected-output|.*~)/d" \\r
+          -e "/^(gnupg-secret-key.asc)/d" \\r
+          -e "/^(gnupg-secret-key.NOTE)/d" \\r
+diff --git a/test/exception-test.cc b/test/exception-test.cc\r
+new file mode 100644\r
+index 0000000..1de06ea\r
+--- /dev/null\r
++++ b/test/exception-test.cc\r
+@@ -0,0 +1,17 @@\r
++#include <stdio.h>\r
++#include <xapian.h>\r
++#include <notmuch.h>\r
++main (int argc, char **argv){\r
++\r
++    notmuch_database_t *notmuch\r
++      = notmuch_database_open ("fakedb",\r
++                                   NOTMUCH_DATABASE_MODE_READ_ONLY);\r
++\r
++  try{\r
++    (void)new Xapian::WritableDatabase ("./nonexistant",                                      Xapian::DB_OPEN);\r
++  } catch (const Xapian::Error &error) {\r
++    printf("caught %s\n",error.get_msg().c_str());\r
++    return 0;\r
++  }\r
++  return 1;\r
++}\r
+diff --git a/test/libnotmuch-abi b/test/libnotmuch-abi\r
+new file mode 100755\r
+index 0000000..a7467b8\r
+--- /dev/null\r
++++ b/test/libnotmuch-abi\r
+@@ -0,0 +1,26 @@\r
++#!/usr/bin/env bash\r
++#\r
++# Copyright (c) 2011 David Bremner\r
++#\r
++\r
++test_description='libnotmuch symbol export and hiding'\r
++\r
++# This subtest tests whether hiding Xapian::Error symbols in libnotmuch\r
++# also hides them for other users of libxapian. This is motivated by\r
++# the discussion in http://gcc.gnu.org/wiki/Visibility'\r
++\r
++. ./test-lib.sh\r
++\r
++run_exception_test(){\r
++    result=$(LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib ./exception-test 2>&1)\r
++}\r
++\r
++output="A Xapian exception occurred opening database: Couldn't stat 'fakedb/.notmuch/xapian'\r
++caught No chert database found at path \`./nonexistant'"\r
++\r
++g++ -o exception-test -I$TEST_DIRECTORY/../lib $TEST_DIRECTORY/exception-test.cc -L$TEST_DIRECTORY/../lib -lnotmuch -lxapian\r
++mkdir -p fakedb/.notmuch\r
++test_expect_success 'running exception test' run_exception_test\r
++test_begin_subtest 'checking output'\r
++test_expect_equal "$result" "$output" \r
++test_done\r
+diff --git a/test/notmuch-test b/test/notmuch-test\r
+index fe85c6a..c7296fa 100755\r
+--- a/test/notmuch-test\r
++++ b/test/notmuch-test\r
+@@ -40,7 +40,7 @@ TESTS="\r
+   emacs-large-search-buffer\r
+   maildir-sync\r
+   crypto\r
+-  symbol-hiding\r
++  libnotmuch-abi\r
+ "\r
+ TESTS=${NOTMUCH_TESTS:=$TESTS}\r
\r
+diff --git a/test/symbol-hiding b/test/symbol-hiding\r
+deleted file mode 100755\r
+index d0b31ae..0000000\r
+--- a/test/symbol-hiding\r
++++ /dev/null\r
+@@ -1,26 +0,0 @@\r
+-#!/usr/bin/env bash\r
+-#\r
+-# Copyright (c) 2011 David Bremner\r
+-#\r
+-\r
+-# This test tests whether hiding Xapian::Error symbols in libnotmuch\r
+-# also hides them for other users of libxapian. This is motivated by\r
+-# the discussion in http://gcc.gnu.org/wiki/Visibility'\r
+-\r
+-test_description='exception symbol hiding'\r
+-\r
+-. ./test-lib.sh\r
+-\r
+-run_test(){\r
+-    result=$(LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib ./symbol-test 2>&1)\r
+-}\r
+-\r
+-output="A Xapian exception occurred opening database: Couldn't stat 'fakedb/.notmuch/xapian'\r
+-caught No chert database found at path \`./nonexistant'"\r
+-\r
+-g++ -o symbol-test -I$TEST_DIRECTORY/../lib $TEST_DIRECTORY/symbol-test.cc -L$TEST_DIRECTORY/../lib -lnotmuch -lxapian\r
+-mkdir -p fakedb/.notmuch\r
+-test_expect_success 'running test' run_test\r
+-test_begin_subtest 'checking output'\r
+-test_expect_equal "$result" "$output" \r
+-test_done\r
+diff --git a/test/symbol-test.cc b/test/symbol-test.cc\r
+deleted file mode 100644\r
+index 1de06ea..0000000\r
+--- a/test/symbol-test.cc\r
++++ /dev/null\r
+@@ -1,17 +0,0 @@\r
+-#include <stdio.h>\r
+-#include <xapian.h>\r
+-#include <notmuch.h>\r
+-main (int argc, char **argv){\r
+-\r
+-    notmuch_database_t *notmuch\r
+-      = notmuch_database_open ("fakedb",\r
+-                                   NOTMUCH_DATABASE_MODE_READ_ONLY);\r
+-\r
+-  try{\r
+-    (void)new Xapian::WritableDatabase ("./nonexistant",                                      Xapian::DB_OPEN);\r
+-  } catch (const Xapian::Error &error) {\r
+-    printf("caught %s\n",error.get_msg().c_str());\r
+-    return 0;\r
+-  }\r
+-  return 1;\r
+-}\r
+-- \r
+1.7.5.4\r
+\r