Signed-off-by: Angus Salkeld <asalkeld(a)redhat.com>
---
configure.ac | 12 ++++++++++++
tests/Makefile.am | 2 ++
tests/bench-log.c | 2 +-
3 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index c8dcd2c..855dfef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -311,6 +311,10 @@ AC_ARG_ENABLE([coverage],
[ --enable-coverage : coverage analysis of the codebase. ],
[ default="no" ])
+AC_ARG_ENABLE([slow-tests],
+ [ --enable-slow-tests : build and run slow tests. ],
+ [ default="no" ])
+
AC_ARG_WITH([socket-dir],
[ --with-socket-dir=DIR : socket dir. ],
[ SOCKETDIR="$withval" ],
@@ -379,6 +383,14 @@ else
COVERAGE_LDFLAGS=""
fi
+
+if test "x${enable_slow_tests}" = xyes ; then
+ AC_DEFINE([HAVE_SLOW_TESTS], 1,[have slow tests])
+ AC_MSG_NOTICE([Enabling Slow tests])
+fi
+AM_CONDITIONAL(HAVE_SLOW_TESTS, [test "x$enable_slow_tests" = xyes])
+
+
AM_CONDITIONAL(USE_TIMERFD, [test "x$ac_cv_func_timerfd_create" = xyes])
# --- callsite sections ---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index fbe1ba0..634e0ed 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -48,6 +48,7 @@ loop_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include
loop_LDADD = -lrt $(top_builddir)/lib/libqb.la
if HAVE_DICT_WORDS
+if HAVE_SLOW_TESTS
EXTRA_DIST += make-log-test
CLEANFILES += write_logs.c
MAINTAINERCLEANFILES += write_logs.c
@@ -63,6 +64,7 @@ distclean-compile:
rm -rf write_logs.c
endif
+endif
bench_log_SOURCES = bench-log.c $(top_builddir)/include/qb/qblog.h
bench_log_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include
diff --git a/tests/bench-log.c b/tests/bench-log.c
index 236ec18..7d54439 100644
--- a/tests/bench-log.c
+++ b/tests/bench-log.c
@@ -82,7 +82,7 @@ main(void)
qb_log(LOG_DEBUG, "%i %u %p", -534, 4508, &i);
}
bm_finish ("qb_log 3 args(int):");
-#ifdef HAVE_DICT_WORDS
+#if defined(HAVE_DICT_WORDS) && defined(HAVE_SLOW_TESTS)
qb_util_stopwatch_start(sw);
log_dict_words();
bm_finish ("qb_log /usr/share/dict/words:");
--
1.7.7.3