--enable-unittests now controls compilation of unittest code. Added crude commandline support for running unittests: ./eidps runtests

remotes/origin/master-1.0.x
Victor Julien 16 years ago
parent 462a346bf6
commit e6400bf456

@ -19,6 +19,12 @@
/* Define to 1 if you have the `pcap' library (-lpcap). */
#undef HAVE_LIBPCAP
/* Define to 1 if you have the `pcre' library (-lpcre). */
#undef HAVE_LIBPCRE
/* Define to 1 if you have the `pthread' library (-lpthread). */
#undef HAVE_LIBPTHREAD
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H

@ -242,12 +242,12 @@ AC_CHECK_HEADER(pcap.h,,[AC_ERROR(pcap.h not found ...)])
fi
# enable the running of unit tests
AC_ARG_ENABLE(unittest,
[ --enable-unittest Enable Running of Unit Tests],
[ enable_unittest=yes
AC_ARG_ENABLE(unittests,
[ --enable-unittests Enable compilation of the unit tests],
[ enable_unittests=yes
])
if test "$enable_unittest" = "yes"; then
CFLAGS="${CFLAGS} -DRUN_UNITTEST"
if test "$enable_unittests" = "yes"; then
CFLAGS="${CFLAGS} -DUNITTESTS"
fi
# enable the loading of sigs XXX remove this when we get a config language

@ -866,8 +866,11 @@ int main(int argc, char **argv)
TmModuleStreamTcpRegister();
TmModuleDebugList();
#ifdef UNITTESTS
/* test and initialize the unittesting subsystem */
UtRunSelftest(); /* inits and cleans up again */
if (argc > 1&& (strcmp(argv[1],"runtests") == 0)) {
UtRunSelftest(); /* inits and cleans up again */
}
UtInitialize();
TmModuleRegisterTests();
SigTableRegisterTests();
@ -880,13 +883,14 @@ int main(int argc, char **argv)
FlowBitRegisterTests();
SigRegisterTests();
DecodePPPRegisterTests();
#ifdef RUN_UNITTEST
UtRunTests();
UtCleanup();
exit(1);
#else /* Implied We did enable running of Unit Tests */
if (argc > 1&& (strcmp(argv[1],"runtests") == 0)) {
UtRunTests();
}
UtCleanup();
#endif /* RUN_UNITTEST */
if (argc > 1&& (strcmp(argv[1],"runtests") == 0)) {
exit(0);
}
#endif /* UNITTESTS */
//LoadConfig();
//exit(1);

Loading…
Cancel
Save