diff options
| author | David Bremner <david@tethera.net> | 2021-10-28 09:32:34 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2021-12-04 12:36:08 -0400 |
| commit | 1643c0459a496b45b601d91e0089fac507a2a6d1 (patch) | |
| tree | 824ca82521b586bcbc4fd8d15af590418d5814ff | |
| parent | 18cdd21b8b2ef056062700607eade43909c32cd2 (diff) | |
test: move system includes to notmuch-test.h
This removes some redudant includes, and will also make it easier to
introduce "#define _GNU_SOURCE", which must come before all system
includes.
| -rwxr-xr-x | test/T562-lib-database.sh | 4 | ||||
| -rwxr-xr-x | test/T563-lib-directory.sh | 4 | ||||
| -rwxr-xr-x | test/T564-lib-query.sh | 4 | ||||
| -rwxr-xr-x | test/T566-lib-message.sh | 3 | ||||
| -rwxr-xr-x | test/T568-lib-thread.sh | 3 | ||||
| -rwxr-xr-x | test/T590-libconfig.sh | 4 | ||||
| -rwxr-xr-x | test/T595-reopen.sh | 2 | ||||
| -rwxr-xr-x | test/T610-message-property.sh | 4 | ||||
| -rwxr-xr-x | test/T620-lock.sh | 3 | ||||
| -rwxr-xr-x | test/T640-database-modified.sh | 5 | ||||
| -rw-r--r-- | test/notmuch-test.h | 6 |
11 files changed, 12 insertions, 30 deletions
diff --git a/test/T562-lib-database.sh b/test/T562-lib-database.sh index 769fe86e..d9f5d18e 100755 --- a/test/T562-lib-database.sh +++ b/test/T562-lib-database.sh @@ -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; diff --git a/test/T563-lib-directory.sh b/test/T563-lib-directory.sh index 28325ff2..ad390c1c 100755 --- a/test/T563-lib-directory.sh +++ b/test/T563-lib-directory.sh @@ -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; diff --git a/test/T564-lib-query.sh b/test/T564-lib-query.sh index 50b0a88e..ff1d4984 100755 --- a/test/T564-lib-query.sh +++ b/test/T564-lib-query.sh @@ -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; diff --git a/test/T566-lib-message.sh b/test/T566-lib-message.sh index ee55ef29..8b61d182 100755 --- a/test/T566-lib-message.sh +++ b/test/T566-lib-message.sh @@ -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; diff --git a/test/T568-lib-thread.sh b/test/T568-lib-thread.sh index 088e66dd..b45836cd 100755 --- a/test/T568-lib-thread.sh +++ b/test/T568-lib-thread.sh @@ -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; diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh index 6c426ae8..eb303444 100755 --- a/test/T590-libconfig.sh +++ b/test/T590-libconfig.sh @@ -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) diff --git a/test/T595-reopen.sh b/test/T595-reopen.sh index 7375e2ac..1a517423 100755 --- a/test/T595-reopen.sh +++ b/test/T595-reopen.sh @@ -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) diff --git a/test/T610-message-property.sh b/test/T610-message-property.sh index d0e52f4a..4ec85474 100755 --- a/test/T610-message-property.sh +++ b/test/T610-message-property.sh @@ -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) { diff --git a/test/T620-lock.sh b/test/T620-lock.sh index 7aaaff2a..8f4c380f 100755 --- a/test/T620-lock.sh +++ b/test/T620-lock.sh @@ -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 diff --git a/test/T640-database-modified.sh b/test/T640-database-modified.sh index 274105c7..636b20c7 100755 --- a/test/T640-database-modified.sh +++ b/test/T640-database-modified.sh @@ -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) { diff --git a/test/notmuch-test.h b/test/notmuch-test.h index 34dbb8e0..3a0e90a3 100644 --- a/test/notmuch-test.h +++ b/test/notmuch-test.h @@ -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 |
