[Oisf-devel] [PATCH 4/7] Add suricata unittests to 'make check'

Eric Leblond eric at regit.org
Mon Jan 31 22:45:38 UTC 2011


This patch adds a run of suricata's unittests to 'make check'
---
 configure.in    |    2 ++
 src/Makefile.am |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/configure.in b/configure.in
index f682e71..dc8d6e0 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 a494c68..7ea6766 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
-- 
1.7.1




More information about the Oisf-devel mailing list