From 149299c7d5136a8fb425ef3cf8953026a1358002 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 4 Oct 2017 21:45:18 +0300 Subject: [PATCH] global: Use check-local in Makefile.am instead of overriding check directly This helps with dependency problems, like running "make check" in lib-storage without "make" first would try to compile the test programs too early and fail. --- src/anvil/Makefile.am | 3 +-- src/auth/Makefile.am | 3 +-- src/director/Makefile.am | 3 +-- src/doveadm/Makefile.am | 3 +-- src/doveadm/dsync/Makefile.am | 3 +-- src/lib-charset/Makefile.am | 3 +-- src/lib-compression/Makefile.am | 3 +-- src/lib-dcrypt/Makefile.am | 4 +--- src/lib-dict-backend/Makefile.am | 3 +-- src/lib-dict/Makefile.am | 21 ++++++++++++++++++--- src/lib-dns/Makefile.am | 3 +-- src/lib-fs/Makefile.am | 3 +-- src/lib-fts/Makefile.am | 3 +-- src/lib-http/Makefile.am | 3 +-- src/lib-imap-client/Makefile.am | 3 +-- src/lib-imap/Makefile.am | 3 +-- src/lib-index/Makefile.am | 3 +-- src/lib-ldap/Makefile.am | 3 +-- src/lib-mail/Makefile.am | 3 +-- src/lib-master/Makefile.am | 3 +-- src/lib-program-client/Makefile.am | 3 +-- src/lib-settings/Makefile.am | 3 +-- src/lib-smtp/Makefile.am | 3 +-- src/lib-storage/Makefile.am | 3 +-- src/lib/Makefile.am | 3 +-- src/plugins/mail-crypt/Makefile.am | 3 +-- src/plugins/pop3-migration/Makefile.am | 3 +-- src/plugins/quota/Makefile.am | 3 +-- src/plugins/var-expand-crypt/Makefile.am | 3 +-- 29 files changed, 46 insertions(+), 60 deletions(-) diff --git a/src/anvil/Makefile.am b/src/anvil/Makefile.am index 01b58ffe74..1af526fe63 100644 --- a/src/anvil/Makefile.am +++ b/src/anvil/Makefile.am @@ -42,8 +42,7 @@ test_penalty_SOURCES = test-penalty.c test_penalty_LDADD = penalty.o $(test_libs) test_penalty_DEPENDENCIES = $(pkglibexec_PROGRAMS) $(test_libs) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/auth/Makefile.am b/src/auth/Makefile.am index 3dfd7a7044..b6e9f291bc 100644 --- a/src/auth/Makefile.am +++ b/src/auth/Makefile.am @@ -248,8 +248,7 @@ test_auth_SOURCES = \ test_auth_LDADD = $(test_libs) $(auth_libs) $(AUTH_LIBS) test_auth_DEPENDENCIES = $(pkglibexec_PROGRAMS) $(test_libs) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/director/Makefile.am b/src/director/Makefile.am index fa14e05cf6..c202353e3e 100644 --- a/src/director/Makefile.am +++ b/src/director/Makefile.am @@ -64,8 +64,7 @@ test_user_directory_SOURCES = test-user-directory.c test_user_directory_LDADD = user-directory.o $(test_libs) test_user_directory_DEPENDENCIES = $(pkglibexec_PROGRAMS) $(test_libs) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/doveadm/Makefile.am b/src/doveadm/Makefile.am index cd5bca9913..cda12ade2b 100644 --- a/src/doveadm/Makefile.am +++ b/src/doveadm/Makefile.am @@ -188,8 +188,7 @@ test_doveadm_util_SOURCES = doveadm-util.c test-doveadm-util.c test_doveadm_util_LDADD = $(test_libs) $(MODULE_LIBS) test_doveadm_util_DEPENDENCIES = $(test_deps) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/doveadm/dsync/Makefile.am b/src/doveadm/dsync/Makefile.am index 16d88bf962..20cbfc74f3 100644 --- a/src/doveadm/dsync/Makefile.am +++ b/src/doveadm/dsync/Makefile.am @@ -70,8 +70,7 @@ test_dsync_mailbox_tree_sync_SOURCES = test-dsync-mailbox-tree-sync.c test_dsync_mailbox_tree_sync_LDADD = dsync-mailbox-tree-sync.lo dsync-mailbox-tree.lo $(test_libs) test_dsync_mailbox_tree_sync_DEPENDENCIES = $(pkglib_LTLIBRARIES) $(test_libs) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib-charset/Makefile.am b/src/lib-charset/Makefile.am index 122d1dff1b..e9d0ea8317 100644 --- a/src/lib-charset/Makefile.am +++ b/src/lib-charset/Makefile.am @@ -29,8 +29,7 @@ test_charset_SOURCES = test-charset.c test_charset_LDADD = libcharset.la $(test_libs) test_charset_DEPENDENCIES = libcharset.la $(test_deps) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib-compression/Makefile.am b/src/lib-compression/Makefile.am index 299209e903..3c6c875a6f 100644 --- a/src/lib-compression/Makefile.am +++ b/src/lib-compression/Makefile.am @@ -45,8 +45,7 @@ test_compression_SOURCES = test-compression.c test_compression_LDADD = $(test_libs) test_compression_DEPENDENCIES = $(test_deps) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib-dcrypt/Makefile.am b/src/lib-dcrypt/Makefile.am index 6d8b5d7377..2dcdf956dc 100644 --- a/src/lib-dcrypt/Makefile.am +++ b/src/lib-dcrypt/Makefile.am @@ -45,9 +45,7 @@ EXTRA_DIST = \ test_programs = test-crypto test-stream noinst_PROGRAMS = $(test_programs) -check: check-am check-test - -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib-dict-backend/Makefile.am b/src/lib-dict-backend/Makefile.am index c255fa70f6..7e24b8b6c7 100644 --- a/src/lib-dict-backend/Makefile.am +++ b/src/lib-dict-backend/Makefile.am @@ -117,8 +117,7 @@ test_dict_sql_DEPENDENCIES = \ ../lib-settings/libsettings.la \ $(test_libs) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs) $(check_PROGRAMS); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib-dict/Makefile.am b/src/lib-dict/Makefile.am index 5bf74d4e80..cd17c883b3 100644 --- a/src/lib-dict/Makefile.am +++ b/src/lib-dict/Makefile.am @@ -44,8 +44,23 @@ test_dict_client_SOURCES = test-dict-client.c test_dict_client_LDADD = $(noinst_LTLIBRARIES) ../lib/liblib.la test_dict_client_DEPENDENCIES = $(noinst_LTLIBRARIES) $(test_libs) -check: check-am check-test -check-test: all-am - for bin in $(test_programs); do \ +test_dict_sql_CFLAGS = $(AM_CPPFLAGS) -DDICT_SRC_DIR=\"$(top_srcdir)/src/lib-dict\" +test_dict_sql_SOURCES = \ + test-dict-sql.c +test_dict_sql_LDADD = \ + $(noinst_LTLIBRARIES) \ + ../lib-sql/libdriver_test.la \ + ../lib-sql/libsql.la \ + ../lib-settings/libsettings.la \ + $(test_libs) +test_dict_sql_DEPENDENCIES = \ + $(noinst_LTLIBRARIES) \ + ../lib-sql/libdriver_test.la \ + ../lib-sql/libsql.la \ + ../lib-settings/libsettings.la \ + $(test_libs) + +check-local: + for bin in $(test_programs) $(check_PROGRAMS); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib-dns/Makefile.am b/src/lib-dns/Makefile.am index 302e37cf3d..cd3c2279df 100644 --- a/src/lib-dns/Makefile.am +++ b/src/lib-dns/Makefile.am @@ -26,8 +26,7 @@ test_dns_util_LDADD = $(test_libs) test_dns_util_CFLAGS = $(AM_CPPFLAGS) \ -I$(top_srcdir)/src/lib-test -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if test "$$bin" = "test-program-client-local"; then \ if ! env NOVALGRIND=yes $(RUN_TEST) ./$$bin; then exit 1; fi; \ diff --git a/src/lib-fs/Makefile.am b/src/lib-fs/Makefile.am index e53bba5365..e5ae056c33 100644 --- a/src/lib-fs/Makefile.am +++ b/src/lib-fs/Makefile.am @@ -64,8 +64,7 @@ test_fs_posix_SOURCES = test-fs-posix.c test_fs_posix_LDADD = $(test_libs) test_fs_posix_DEPENDENCIES = $(test_deps) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib-fts/Makefile.am b/src/lib-fts/Makefile.am index ee37a6795c..2eeb38fc1e 100644 --- a/src/lib-fts/Makefile.am +++ b/src/lib-fts/Makefile.am @@ -149,8 +149,7 @@ test_fts_tokenizer_SOURCES = test-fts-tokenizer.c test_fts_tokenizer_LDADD = fts-tokenizer.lo fts-tokenizer-generic.lo fts-tokenizer-address.lo fts-tokenizer-common.lo ../lib-mail/libmail.la $(test_libs) test_fts_tokenizer_DEPENDENCIES = ../lib-mail/libmail.la $(test_deps) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib-http/Makefile.am b/src/lib-http/Makefile.am index 6e3e2e410e..f2cf478524 100644 --- a/src/lib-http/Makefile.am +++ b/src/lib-http/Makefile.am @@ -184,8 +184,7 @@ test_http_server_errors_LDADD = \ test_http_server_errors_DEPENDENCIES = \ $(test_http_deps) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib-imap-client/Makefile.am b/src/lib-imap-client/Makefile.am index 3dfcf197fd..8fe8a8d091 100644 --- a/src/lib-imap-client/Makefile.am +++ b/src/lib-imap-client/Makefile.am @@ -47,8 +47,7 @@ test_imapc_client_SOURCES = test-imapc-client.c test_imapc_client_LDADD = $(test_libs) test_imapc_client_DEPENDENCIES = $(test_deps) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib-imap/Makefile.am b/src/lib-imap/Makefile.am index 45b62973b0..9223a47179 100644 --- a/src/lib-imap/Makefile.am +++ b/src/lib-imap/Makefile.am @@ -92,8 +92,7 @@ test_imap_util_SOURCES = test-imap-util.c test_imap_util_LDADD = imap-util.lo imap-arg.lo $(test_libs) test_imap_util_DEPENDENCIES = $(test_deps) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib-index/Makefile.am b/src/lib-index/Makefile.am index ecaac792af..4c77c00ecc 100644 --- a/src/lib-index/Makefile.am +++ b/src/lib-index/Makefile.am @@ -111,8 +111,7 @@ test_mail_transaction_log_view_SOURCES = test-mail-transaction-log-view.c test_mail_transaction_log_view_LDADD = mail-transaction-log-view.lo $(test_libs) test_mail_transaction_log_view_DEPENDENCIES = $(test_deps) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib-ldap/Makefile.am b/src/lib-ldap/Makefile.am index 8fba6ae82a..14f53a6ba4 100644 --- a/src/lib-ldap/Makefile.am +++ b/src/lib-ldap/Makefile.am @@ -36,8 +36,7 @@ test_libs = \ ../lib-ssl-iostream/libssl_iostream.la \ ../lib/liblib.la -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib-mail/Makefile.am b/src/lib-mail/Makefile.am index 86368a3e8b..ba0cf0f091 100644 --- a/src/lib-mail/Makefile.am +++ b/src/lib-mail/Makefile.am @@ -222,8 +222,7 @@ test_rfc822_parser_SOURCES = test-rfc822-parser.c test_rfc822_parser_LDADD = $(test_libs) test_rfc822_parser_DEPENDENCIES = $(test_deps) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib-master/Makefile.am b/src/lib-master/Makefile.am index 7d68df37bf..24c613bcf4 100644 --- a/src/lib-master/Makefile.am +++ b/src/lib-master/Makefile.am @@ -64,8 +64,7 @@ test_master_service_settings_cache_SOURCES = test-master-service-settings-cache. test_master_service_settings_cache_LDADD = master-service-settings-cache.lo ../lib-settings/libsettings.la $(test_libs) test_master_service_settings_cache_DEPENDENCIES = $(test_deps) ../lib-settings/libsettings.la -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib-program-client/Makefile.am b/src/lib-program-client/Makefile.am index f4f5015981..f7863ba5d9 100644 --- a/src/lib-program-client/Makefile.am +++ b/src/lib-program-client/Makefile.am @@ -45,8 +45,7 @@ test_program_client_unix_LDADD = $(test_libs) test_program_client_net_SOURCE = test-program-client-net.c test_program_client_net_LDADD = $(test_libs) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if test "$$bin" = "test-program-client-local"; then \ if ! env NOVALGRIND=yes $(RUN_TEST) ./$$bin; then exit 1; fi; \ diff --git a/src/lib-settings/Makefile.am b/src/lib-settings/Makefile.am index 5434e32b56..7b868ba9c3 100644 --- a/src/lib-settings/Makefile.am +++ b/src/lib-settings/Makefile.am @@ -29,8 +29,7 @@ test_settings_parser_SOURCES = test-settings-parser.c test_settings_parser_LDADD = $(test_libs) test_settings_parser_DEPENDENCIES = $(test_libs) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib-smtp/Makefile.am b/src/lib-smtp/Makefile.am index 376cb8957f..696f2bc8d0 100644 --- a/src/lib-smtp/Makefile.am +++ b/src/lib-smtp/Makefile.am @@ -60,8 +60,7 @@ test_smtp_submit_LDFLAGS = -export-dynamic test_smtp_submit_LDADD = $(test_libs) test_smtp_submit_DEPENDENCIES = $(test_deps) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib-storage/Makefile.am b/src/lib-storage/Makefile.am index e1b7001865..256ceb7c4c 100644 --- a/src/lib-storage/Makefile.am +++ b/src/lib-storage/Makefile.am @@ -161,8 +161,7 @@ test_mail_storage_SOURCES = test-mail-storage.c test_mail_storage_LDADD = libstorage.la $(LIBDOVECOT) test_mail_storage_DEPENDENCIES = libstorage.la $(LIBDOVECOT_DEPS) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 31577c078a..1cffc66ba6 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -399,8 +399,7 @@ test_headers = \ test_lib_LDADD = $(test_libs) test_lib_DEPENDENCIES = $(test_libs) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/plugins/mail-crypt/Makefile.am b/src/plugins/mail-crypt/Makefile.am index f90f0e2770..942dc87894 100644 --- a/src/plugins/mail-crypt/Makefile.am +++ b/src/plugins/mail-crypt/Makefile.am @@ -108,8 +108,7 @@ noinst_HEADERS = \ mail-crypt-key.h \ fs-crypt-settings.h -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! env $(test_options) $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/plugins/pop3-migration/Makefile.am b/src/plugins/pop3-migration/Makefile.am index 1c8750b4e5..f58d06532e 100644 --- a/src/plugins/pop3-migration/Makefile.am +++ b/src/plugins/pop3-migration/Makefile.am @@ -35,8 +35,7 @@ test_pop3_migration_plugin_SOURCES = test-pop3-migration-plugin.c test_pop3_migration_plugin_LDADD = pop3-migration-plugin.lo $(test_libs) test_pop3_migration_plugin_DEPENDENCIES = $(test_deps) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/plugins/quota/Makefile.am b/src/plugins/quota/Makefile.am index e6bf7b488a..5a0e52fa92 100644 --- a/src/plugins/quota/Makefile.am +++ b/src/plugins/quota/Makefile.am @@ -135,8 +135,7 @@ test_quota_util_SOURCES = test-quota-util.c test_quota_util_LDADD = quota-util.lo $(test_libs) test_quota_util_DEPENDENCIES = quota-util.lo $(test_deps) -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ done diff --git a/src/plugins/var-expand-crypt/Makefile.am b/src/plugins/var-expand-crypt/Makefile.am index 9f4d73a42e..6feb1a742d 100644 --- a/src/plugins/var-expand-crypt/Makefile.am +++ b/src/plugins/var-expand-crypt/Makefile.am @@ -31,8 +31,7 @@ test_var_expand_crypt_LDADD = \ ../../lib-dovecot/libdovecot.la \ lib20_auth_var_expand_crypt.la -check: check-am check-test -check-test: all-am +check-local: for bin in $(test_programs); do \ if ! env $(test_options) $(RUN_TEST) ./$$bin; then exit 1; fi; \ done -- 2.47.3