Mercurial > dovecot > core-2.2
diff src/lib-charset/Makefile.am @ 18714:dcaf508860ad
lib-charset: Added a minimal unit test
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 16 May 2015 12:46:38 +0300 |
parents | 36ca0e03bd06 |
children | 170f155eb2b2 |
line wrap: on
line diff
--- a/src/lib-charset/Makefile.am Sat May 16 11:47:09 2015 +0300 +++ b/src/lib-charset/Makefile.am Sat May 16 12:46:38 2015 +0300 @@ -1,7 +1,8 @@ noinst_LTLIBRARIES = libcharset.la AM_CPPFLAGS = \ - -I$(top_srcdir)/src/lib + -I$(top_srcdir)/src/lib \ + -I$(top_srcdir)/src/lib-test libcharset_la_LIBADD = $(LTLIBICONV) libcharset_la_SOURCES = \ @@ -13,3 +14,23 @@ pkginc_libdir=$(pkgincludedir) pkginc_lib_HEADERS = $(headers) + +test_programs = \ + test-charset + +noinst_PROGRAMS = $(test_programs) + +test_libs = \ + ../lib-test/libtest.la \ + ../lib/liblib.la +test_deps = $(noinst_LTLIBRARIES) $(test_libs) + +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 + for bin in $(test_programs); do \ + if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ + done