From 0044bb221b54552c5a2a0ec83388f3e196cecc22 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Mon, 31 Jan 2011 23:45:38 +0100 Subject: [PATCH] Add suricata unittests to 'make check' This patch adds a run of suricata's unittests to 'make check' --- configure.in | 2 ++ src/Makefile.am | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/configure.in b/configure.in index f682e71161..dc8d6e0c2a 100644 --- a/configure.in +++ b/configure.in @@ -666,6 +666,8 @@ AC_CHECK_HEADER(pcap.h,,[AC_ERROR(pcap.h not found ...)]) CFLAGS="${CFLAGS} -DUNITTESTS" ]) + AM_CONDITIONAL([BUILD_UNITTESTS], [test "x$enable_unittests" = "xyes"]) + # enable native timeval for unified alert output AC_ARG_ENABLE(unified-native-timeval, AS_HELP_STRING([--enable-unified-native-timeval], [Use native timeval for unified outputs]),,[enable_unified_native_timeval=no]) diff --git a/src/Makefile.am b/src/Makefile.am index a494c6859b..7ea6766f58 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -253,3 +253,7 @@ endif #suricata_CFLAGS = -Wall -fno-strict-aliasing +if BUILD_UNITTESTS +check: + $(top_builddir)/src/suricata -u -c $(top_srcdir)/suricata.yaml +endif