Skip to content

Commit

Permalink
global: Use check-local in Makefile.am instead of overriding check di…
Browse files Browse the repository at this point in the history
…rectly

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.
  • Loading branch information
sirainen authored and cmouse committed Oct 11, 2017
1 parent 3cd37f7 commit 149299c
Show file tree
Hide file tree
Showing 29 changed files with 46 additions and 60 deletions.
3 changes: 1 addition & 2 deletions src/anvil/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/auth/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/director/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/doveadm/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/doveadm/dsync/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/lib-charset/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/lib-compression/Makefile.am
Expand Up @@ -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
4 changes: 1 addition & 3 deletions src/lib-dcrypt/Makefile.am
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/lib-dict-backend/Makefile.am
Expand Up @@ -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
21 changes: 18 additions & 3 deletions src/lib-dict/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/lib-dns/Makefile.am
Expand Up @@ -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; \
Expand Down
3 changes: 1 addition & 2 deletions src/lib-fs/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/lib-fts/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/lib-http/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/lib-imap-client/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/lib-imap/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/lib-index/Makefile.am
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/lib-ldap/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/lib-mail/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/lib-master/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/lib-program-client/Makefile.am
Expand Up @@ -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; \
Expand Down
3 changes: 1 addition & 2 deletions src/lib-settings/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/lib-smtp/Makefile.am
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/lib-storage/Makefile.am
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/lib/Makefile.am
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/mail-crypt/Makefile.am
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/pop3-migration/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/plugins/quota/Makefile.am
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/plugins/var-expand-crypt/Makefile.am
Expand Up @@ -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
Expand Down

0 comments on commit 149299c

Please sign in to comment.