]> git.notmuchmail.org Git - notmuch/commitdiff
test: move system includes to notmuch-test.h
authorDavid Bremner <david@tethera.net>
Thu, 28 Oct 2021 12:32:34 +0000 (09:32 -0300)
committerDavid Bremner <david@tethera.net>
Sat, 4 Dec 2021 16:36:08 +0000 (12:36 -0400)
This removes some redudant includes, and will also make it easier to
introduce "#define _GNU_SOURCE", which must come before all system
includes.

test/T562-lib-database.sh
test/T563-lib-directory.sh
test/T564-lib-query.sh
test/T566-lib-message.sh
test/T568-lib-thread.sh
test/T590-libconfig.sh
test/T595-reopen.sh
test/T610-message-property.sh
test/T620-lock.sh
test/T640-database-modified.sh
test/notmuch-test.h

index 769fe86e6f8a347d86c9d49af17c26fd31ae94d5..d9f5d18e09aab9535000227cdc0ee9debb9716b9 100755 (executable)
@@ -9,10 +9,8 @@ test_begin_subtest "building database"
 test_expect_success "NOTMUCH_NEW"
 
 cat <<EOF > c_head
-#include <stdio.h>
-#include <notmuch.h>
 #include <notmuch-test.h>
-#include <talloc.h>
+
 int main (int argc, char** argv)
 {
    notmuch_database_t *db;
index 28325ff23605cae0ea644d13c69b2fc0b2bb4896..ad390c1cb384d7d218645817b63fe33925d46225 100755 (executable)
@@ -9,10 +9,8 @@ test_begin_subtest "building database"
 test_expect_success "NOTMUCH_NEW"
 
 cat <<EOF > c_head
-#include <stdio.h>
-#include <notmuch.h>
 #include <notmuch-test.h>
-#include <talloc.h>
+
 int main (int argc, char** argv)
 {
    notmuch_database_t *db;
index 50b0a88e0793ada49f486cf463865ac064445085..ff1d49849bc571775d69a9af3d46ddaf89d23cb7 100755 (executable)
@@ -9,10 +9,8 @@ test_begin_subtest "building database"
 test_expect_success "NOTMUCH_NEW"
 
 cat <<EOF > c_head
-#include <stdio.h>
-#include <notmuch.h>
 #include <notmuch-test.h>
-#include <talloc.h>
+
 int main (int argc, char** argv)
 {
    notmuch_database_t *db;
index ee55ef291d7a44c23a2728cf26c9af36be8f1107..8b61d18215af0698803c0c0b4b4fab0762a6f3e4 100755 (executable)
@@ -19,9 +19,8 @@ cat <<'EOF' > c_tail
 EOF
 
 cat <<EOF > c_head0
-#include <stdio.h>
-#include <notmuch.h>
 #include <notmuch-test.h>
+
 int main (int argc, char** argv)
 {
    notmuch_database_t *db;
index 088e66dd937313bd1f9c44d60513f998f2b3dc7a..b45836cdd989ca6ac25bc58bc15f7a13fa38dd63 100755 (executable)
@@ -24,9 +24,8 @@ cat <<'EOF' > c_tail
 EOF
 
 cat <<EOF > c_head
-#include <stdio.h>
-#include <notmuch.h>
 #include <notmuch-test.h>
+
 int main (int argc, char** argv)
 {
    notmuch_database_t *db;
index 6c426ae8f6365a578c9f892675aa13c83fb2f6a7..eb3034448116c45d0571f6c871f49760e4a52adc 100755 (executable)
@@ -23,8 +23,6 @@ EOF
 }
 
 cat <<EOF > c_head
-#include <string.h>
-#include <stdlib.h>
 #include <notmuch-test.h>
 
 int main (int argc, char** argv)
@@ -639,8 +637,6 @@ cp notmuch-config.bak notmuch-config
 test_expect_equal_file EXPECTED OUTPUT
 
 cat <<EOF > c_head2
-#include <string.h>
-#include <stdlib.h>
 #include <notmuch-test.h>
 
 int main (int argc, char** argv)
index 7375e2acefbdb7ce947acc475e0af68778f4d600..1a517423e3e476a2acaa4c8b871badadfb7084f8 100755 (executable)
@@ -6,8 +6,6 @@ test_description="library reopen API"
 add_email_corpus
 
 cat <<EOF > c_head
-#include <string.h>
-#include <stdlib.h>
 #include <notmuch-test.h>
 
 int main (int argc, char** argv)
index d0e52f4ac46cbb481b76197682f43ecb3adce728..4ec854748532d105cd5e1a71256536b066b89cf3 100755 (executable)
@@ -6,10 +6,6 @@ test_description="message property API"
 add_email_corpus
 
 cat <<EOF > c_head
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <talloc.h>
 #include <notmuch-test.h>
 
 void print_properties (notmuch_message_t *message, const char *prefix, notmuch_bool_t exact) {
index 7aaaff2ababea2bc9ef6a6cd7bc9844782a30f38..8f4c380f110891f402038927d5c5e37c872b3dc5 100755 (executable)
@@ -9,9 +9,6 @@ if [ $NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK -ne 1 ]; then
     test_subtest_known_broken
 fi
 test_C ${MAIL_DIR} <<'EOF'
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/wait.h>
 #include <notmuch-test.h>
 
 void
index 274105c708fa2d4c73429520e3811fcdce6debff..636b20c71eda0ab214f2c7b9da98e10d43398b6c 100755 (executable)
@@ -10,11 +10,8 @@ test_begin_subtest "catching DatabaseModifiedError in _notmuch_message_ensure_me
 first_id=$(notmuch search --output=messages '*'| head -1 | sed s/^id://)
 
 test_C ${MAIL_DIR} <<EOF
-#include <unistd.h>
-#include <stdlib.h>
 #include <notmuch-test.h>
-#include <talloc.h>
-#include <assert.h>
+
 int
 main (int argc, char **argv)
 {
index 34dbb8e0403feefc4be402178943d8576a8d9c01..3a0e90a3ecf93200e5f38a854e2c57183dacda8b 100644 (file)
@@ -1,7 +1,13 @@
 #ifndef _NOTMUCH_TEST_H
 #define _NOTMUCH_TEST_H
+#include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <sys/wait.h>
+#include <talloc.h>
+#include <unistd.h>
+
 #include <notmuch.h>
 
 inline static void