From: Victor Julien Date: Fri, 29 May 2015 12:00:40 +0000 (+0200) Subject: startup: move RunUnittests to StartInternalRunMode X-Git-Tag: suricata-3.1RC1~271 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ab83288acf824b7295a15a09ec6e582665939c1;p=thirdparty%2Fsuricata.git startup: move RunUnittests to StartInternalRunMode --- diff --git a/src/suricata.c b/src/suricata.c index 13eb250124..f5ed5136e1 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -1930,6 +1930,8 @@ int StartInternalRunMode(SCInstance *suri, int argc, char **argv) return TM_ECODE_DONE; case RUNMODE_LIST_UNITTEST: RunUnittests(1, suri->regex_arg); + case RUNMODE_UNITTEST: + RunUnittests(0, suri->regex_arg); #ifdef OS_WIN32 case RUNMODE_INSTALL_SERVICE: if (SCServiceInstall(argc, argv)) { @@ -2243,6 +2245,10 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } + if (FinalizeRunMode(&suri, argv) != TM_ECODE_OK) { + exit(EXIT_FAILURE); + } + switch (StartInternalRunMode(&suri, argc, argv)) { case TM_ECODE_DONE: exit(EXIT_SUCCESS); @@ -2250,13 +2256,6 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } - if (FinalizeRunMode(&suri, argv) != TM_ECODE_OK) { - exit(EXIT_FAILURE); - } - - if (suri.run_mode == RUNMODE_UNITTEST) - RunUnittests(0, suri.regex_arg); - #ifdef __SC_CUDA_SUPPORT__ /* Init the CUDA environment */ SCCudaInitCudaEnvironment();