Browse code

add unit tests for binaries enable unit tests by default (if check is available) add --enable-coverage to run gcov/lcov add --enable-tests-install to install test files

git-svn: trunk@3935

Török Edvin authored on 2008/07/11 02:08:41
Showing 28 changed files
... ...
@@ -1,3 +1,10 @@
1
+Thu Jul 10 19:41:37 EEST 2008 (edwin)
2
+-------------------------------------
3
+ * unit_tests/: add unit tests for binaries
4
+ * build system: enable unit tests by default (if check is available)
5
+		 add --enable-coverage to run gcov/lcov
6
+		 add --enable-tests-install to install test files 
7
+
1 8
 Thu Jul 10 16:02:50 EEST 2008 (edwin)
2 9
 ------------------------------------
3 10
  * unit_tests/:
... ...
@@ -149,6 +149,8 @@ ECHO_T = @ECHO_T@
149 149
 EGREP = @EGREP@
150 150
 EXEEXT = @EXEEXT@
151 151
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
152
+GCOV = @GCOV@
153
+GENHTML = @GENHTML@
152 154
 GETENT = @GETENT@
153 155
 GPERF = @GPERF@
154 156
 GREP = @GREP@
... ...
@@ -159,6 +161,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
159 159
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
160 160
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
161 161
 LCHECK = @LCHECK@
162
+LCOV = @LCOV@
162 163
 LDFLAGS = @LDFLAGS@
163 164
 LIBBZ2 = @LIBBZ2@
164 165
 LIBBZ2_PREFIX = @LIBBZ2_PREFIX@
... ...
@@ -111,9 +111,6 @@
111 111
 /* Enable 'check' unit tests */
112 112
 #undef HAVE_CHECK
113 113
 
114
-/* Define to 1 if you have the <check.h> header file. */
115
-#undef HAVE_CHECK_H
116
-
117 114
 /* ancillary data style fd pass */
118 115
 #undef HAVE_CONTROL_IN_MSGHDR
119 116
 
... ...
@@ -131,6 +131,8 @@ ECHO_T = @ECHO_T@
131 131
 EGREP = @EGREP@
132 132
 EXEEXT = @EXEEXT@
133 133
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
134
+GCOV = @GCOV@
135
+GENHTML = @GENHTML@
134 136
 GETENT = @GETENT@
135 137
 GPERF = @GPERF@
136 138
 GREP = @GREP@
... ...
@@ -141,6 +143,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
141 141
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
142 142
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
143 143
 LCHECK = @LCHECK@
144
+LCOV = @LCOV@
144 145
 LDFLAGS = @LDFLAGS@
145 146
 LIBBZ2 = @LIBBZ2@
146 147
 LIBBZ2_PREFIX = @LIBBZ2_PREFIX@
... ...
@@ -116,6 +116,8 @@ ECHO_T = @ECHO_T@
116 116
 EGREP = @EGREP@
117 117
 EXEEXT = @EXEEXT@
118 118
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
119
+GCOV = @GCOV@
120
+GENHTML = @GENHTML@
119 121
 GETENT = @GETENT@
120 122
 GPERF = @GPERF@
121 123
 GREP = @GREP@
... ...
@@ -126,6 +128,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
126 126
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
127 127
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
128 128
 LCHECK = @LCHECK@
129
+LCOV = @LCOV@
129 130
 LDFLAGS = @LDFLAGS@
130 131
 LIBBZ2 = @LIBBZ2@
131 132
 LIBBZ2_PREFIX = @LIBBZ2_PREFIX@
... ...
@@ -136,6 +136,8 @@ ECHO_T = @ECHO_T@
136 136
 EGREP = @EGREP@
137 137
 EXEEXT = @EXEEXT@
138 138
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
139
+GCOV = @GCOV@
140
+GENHTML = @GENHTML@
139 141
 GETENT = @GETENT@
140 142
 GPERF = @GPERF@
141 143
 GREP = @GREP@
... ...
@@ -146,6 +148,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
146 146
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
147 147
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
148 148
 LCHECK = @LCHECK@
149
+LCOV = @LCOV@
149 150
 LDFLAGS = @LDFLAGS@
150 151
 LIBBZ2 = @LIBBZ2@
151 152
 LIBBZ2_PREFIX = @LIBBZ2_PREFIX@
... ...
@@ -125,6 +125,8 @@ ECHO_T = @ECHO_T@
125 125
 EGREP = @EGREP@
126 126
 EXEEXT = @EXEEXT@
127 127
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
128
+GCOV = @GCOV@
129
+GENHTML = @GENHTML@
128 130
 GETENT = @GETENT@
129 131
 GPERF = @GPERF@
130 132
 GREP = @GREP@
... ...
@@ -135,6 +137,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
135 135
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
136 136
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
137 137
 LCHECK = @LCHECK@
138
+LCOV = @LCOV@
138 139
 LDFLAGS = @LDFLAGS@
139 140
 LIBBZ2 = @LIBBZ2@
140 141
 LIBBZ2_PREFIX = @LIBBZ2_PREFIX@
... ...
@@ -118,6 +118,8 @@ ECHO_T = @ECHO_T@
118 118
 EGREP = @EGREP@
119 119
 EXEEXT = @EXEEXT@
120 120
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
121
+GCOV = @GCOV@
122
+GENHTML = @GENHTML@
121 123
 GETENT = @GETENT@
122 124
 GPERF = @GPERF@
123 125
 GREP = @GREP@
... ...
@@ -128,6 +130,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
128 128
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
129 129
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
130 130
 LCHECK = @LCHECK@
131
+LCOV = @LCOV@
131 132
 LDFLAGS = @LDFLAGS@
132 133
 LIBBZ2 = @LIBBZ2@
133 134
 LIBBZ2_PREFIX = @LIBBZ2_PREFIX@
... ...
@@ -869,6 +869,13 @@ VERSIONSCRIPT_TRUE
869 869
 VERSIONSCRIPT_FALSE
870 870
 GPERF
871 871
 LCHECK
872
+ENABLE_COVERAGE_TRUE
873
+ENABLE_COVERAGE_FALSE
874
+ENABLE_UT_INSTALL_TRUE
875
+ENABLE_UT_INSTALL_FALSE
876
+GCOV
877
+LCOV
878
+GENHTML
872 879
 MAINTAINER_MODE_TRUE
873 880
 MAINTAINER_MODE_FALSE
874 881
 MAINT
... ...
@@ -1498,7 +1505,9 @@ Optional Features:
1498 1498
   --disable-libtool-lock  avoid locking (might break parallel builds)
1499 1499
   --disable-gcc-vcheck	  do not check for buggy gcc version
1500 1500
   --enable-experimental	enable experimental code
1501
-  --enable-check           Enable 'check' unit tests
1501
+  --enable-check           Enable 'check' unit tests (default=auto)
1502
+  --enable-tests-install  install unit tests [default=no]
1503
+  --enable-coverage       turn on test coverage [default=no]
1502 1504
   --enable-maintainer-mode enable make rules and dependencies not useful
1503 1505
                           (and sometimes confusing) to the casual installer
1504 1506
   --disable-zlib-vcheck	  do not check for buggy zlib version
... ...
@@ -4768,7 +4777,7 @@ ia64-*-hpux*)
4768 4768
   ;;
4769 4769
 *-*-irix6*)
4770 4770
   # Find out which ABI we are using.
4771
-  echo '#line 4771 "configure"' > conftest.$ac_ext
4771
+  echo '#line 4780 "configure"' > conftest.$ac_ext
4772 4772
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
4773 4773
   (eval $ac_compile) 2>&5
4774 4774
   ac_status=$?
... ...
@@ -6858,11 +6867,11 @@ else
6858 6858
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
6859 6859
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
6860 6860
    -e 's:$: $lt_compiler_flag:'`
6861
-   (eval echo "\"\$as_me:6861: $lt_compile\"" >&5)
6861
+   (eval echo "\"\$as_me:6870: $lt_compile\"" >&5)
6862 6862
    (eval "$lt_compile" 2>conftest.err)
6863 6863
    ac_status=$?
6864 6864
    cat conftest.err >&5
6865
-   echo "$as_me:6865: \$? = $ac_status" >&5
6865
+   echo "$as_me:6874: \$? = $ac_status" >&5
6866 6866
    if (exit $ac_status) && test -s "$ac_outfile"; then
6867 6867
      # The compiler can only warn and ignore the option if not recognized
6868 6868
      # So say no if there are warnings other than the usual output.
... ...
@@ -7148,11 +7157,11 @@ else
7148 7148
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7149 7149
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7150 7150
    -e 's:$: $lt_compiler_flag:'`
7151
-   (eval echo "\"\$as_me:7151: $lt_compile\"" >&5)
7151
+   (eval echo "\"\$as_me:7160: $lt_compile\"" >&5)
7152 7152
    (eval "$lt_compile" 2>conftest.err)
7153 7153
    ac_status=$?
7154 7154
    cat conftest.err >&5
7155
-   echo "$as_me:7155: \$? = $ac_status" >&5
7155
+   echo "$as_me:7164: \$? = $ac_status" >&5
7156 7156
    if (exit $ac_status) && test -s "$ac_outfile"; then
7157 7157
      # The compiler can only warn and ignore the option if not recognized
7158 7158
      # So say no if there are warnings other than the usual output.
... ...
@@ -7252,11 +7261,11 @@ else
7252 7252
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7253 7253
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7254 7254
    -e 's:$: $lt_compiler_flag:'`
7255
-   (eval echo "\"\$as_me:7255: $lt_compile\"" >&5)
7255
+   (eval echo "\"\$as_me:7264: $lt_compile\"" >&5)
7256 7256
    (eval "$lt_compile" 2>out/conftest.err)
7257 7257
    ac_status=$?
7258 7258
    cat out/conftest.err >&5
7259
-   echo "$as_me:7259: \$? = $ac_status" >&5
7259
+   echo "$as_me:7268: \$? = $ac_status" >&5
7260 7260
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
7261 7261
    then
7262 7262
      # The compiler can only warn and ignore the option if not recognized
... ...
@@ -9629,7 +9638,7 @@ else
9629 9629
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
9630 9630
   lt_status=$lt_dlunknown
9631 9631
   cat > conftest.$ac_ext <<EOF
9632
-#line 9632 "configure"
9632
+#line 9641 "configure"
9633 9633
 #include "confdefs.h"
9634 9634
 
9635 9635
 #if HAVE_DLFCN_H
... ...
@@ -9729,7 +9738,7 @@ else
9729 9729
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
9730 9730
   lt_status=$lt_dlunknown
9731 9731
   cat > conftest.$ac_ext <<EOF
9732
-#line 9732 "configure"
9732
+#line 9741 "configure"
9733 9733
 #include "confdefs.h"
9734 9734
 
9735 9735
 #if HAVE_DLFCN_H
... ...
@@ -13044,37 +13053,30 @@ _ACEOF
13044 13044
 fi
13045 13045
 
13046 13046
 
13047
-enable_check_ut=no
13047
+enable_check_ut=auto
13048
+enable_ut_install=no
13048 13049
 # Check whether --enable-check was given.
13049 13050
 if test "${enable_check+set}" = set; then
13050
-  enableval=$enable_check; enable_check_ut=yes
13051
+  enableval=$enable_check; enable_check_ut=$enableval
13052
+else
13053
+  enable_check_ut="auto"
13051 13054
 fi
13052 13055
 
13053 13056
 
13054 13057
 LCHECK=""
13055 13058
 if test "$enable_check_ut" != "no" ; then
13056
-
13057
-cat >>confdefs.h <<\_ACEOF
13058
-#define HAVE_CHECK 1
13059
-_ACEOF
13060
-
13061
-
13062
-for ac_header in check.h
13063
-do
13064
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13065
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
13066
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
13067
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
13068
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
13059
+    if test "${ac_cv_header_check_h+set}" = set; then
13060
+  { echo "$as_me:$LINENO: checking for check.h" >&5
13061
+echo $ECHO_N "checking for check.h... $ECHO_C" >&6; }
13062
+if test "${ac_cv_header_check_h+set}" = set; then
13069 13063
   echo $ECHO_N "(cached) $ECHO_C" >&6
13070 13064
 fi
13071
-ac_res=`eval echo '${'$as_ac_Header'}'`
13072
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
13073
-echo "${ECHO_T}$ac_res" >&6; }
13065
+{ echo "$as_me:$LINENO: result: $ac_cv_header_check_h" >&5
13066
+echo "${ECHO_T}$ac_cv_header_check_h" >&6; }
13074 13067
 else
13075 13068
   # Is the header compilable?
13076
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
13077
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
13069
+{ echo "$as_me:$LINENO: checking check.h usability" >&5
13070
+echo $ECHO_N "checking check.h usability... $ECHO_C" >&6; }
13078 13071
 cat >conftest.$ac_ext <<_ACEOF
13079 13072
 /* confdefs.h.  */
13080 13073
 _ACEOF
... ...
@@ -13082,7 +13084,7 @@ cat confdefs.h >>conftest.$ac_ext
13082 13082
 cat >>conftest.$ac_ext <<_ACEOF
13083 13083
 /* end confdefs.h.  */
13084 13084
 $ac_includes_default
13085
-#include <$ac_header>
13085
+#include <check.h>
13086 13086
 _ACEOF
13087 13087
 rm -f conftest.$ac_objext
13088 13088
 if { (ac_try="$ac_compile"
... ...
@@ -13114,15 +13116,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13114 13114
 echo "${ECHO_T}$ac_header_compiler" >&6; }
13115 13115
 
13116 13116
 # Is the header present?
13117
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
13118
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
13117
+{ echo "$as_me:$LINENO: checking check.h presence" >&5
13118
+echo $ECHO_N "checking check.h presence... $ECHO_C" >&6; }
13119 13119
 cat >conftest.$ac_ext <<_ACEOF
13120 13120
 /* confdefs.h.  */
13121 13121
 _ACEOF
13122 13122
 cat confdefs.h >>conftest.$ac_ext
13123 13123
 cat >>conftest.$ac_ext <<_ACEOF
13124 13124
 /* end confdefs.h.  */
13125
-#include <$ac_header>
13125
+#include <check.h>
13126 13126
 _ACEOF
13127 13127
 if { (ac_try="$ac_cpp conftest.$ac_ext"
13128 13128
 case "(($ac_try" in
... ...
@@ -13155,25 +13157,25 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
13155 13155
 # So?  What about this header?
13156 13156
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
13157 13157
   yes:no: )
13158
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
13159
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
13160
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
13161
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
13158
+    { echo "$as_me:$LINENO: WARNING: check.h: accepted by the compiler, rejected by the preprocessor!" >&5
13159
+echo "$as_me: WARNING: check.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
13160
+    { echo "$as_me:$LINENO: WARNING: check.h: proceeding with the compiler's result" >&5
13161
+echo "$as_me: WARNING: check.h: proceeding with the compiler's result" >&2;}
13162 13162
     ac_header_preproc=yes
13163 13163
     ;;
13164 13164
   no:yes:* )
13165
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
13166
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
13167
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
13168
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
13169
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
13170
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
13171
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
13172
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
13173
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
13174
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
13175
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
13176
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
13165
+    { echo "$as_me:$LINENO: WARNING: check.h: present but cannot be compiled" >&5
13166
+echo "$as_me: WARNING: check.h: present but cannot be compiled" >&2;}
13167
+    { echo "$as_me:$LINENO: WARNING: check.h:     check for missing prerequisite headers?" >&5
13168
+echo "$as_me: WARNING: check.h:     check for missing prerequisite headers?" >&2;}
13169
+    { echo "$as_me:$LINENO: WARNING: check.h: see the Autoconf documentation" >&5
13170
+echo "$as_me: WARNING: check.h: see the Autoconf documentation" >&2;}
13171
+    { echo "$as_me:$LINENO: WARNING: check.h:     section \"Present But Cannot Be Compiled\"" >&5
13172
+echo "$as_me: WARNING: check.h:     section \"Present But Cannot Be Compiled\"" >&2;}
13173
+    { echo "$as_me:$LINENO: WARNING: check.h: proceeding with the preprocessor's result" >&5
13174
+echo "$as_me: WARNING: check.h: proceeding with the preprocessor's result" >&2;}
13175
+    { echo "$as_me:$LINENO: WARNING: check.h: in the future, the compiler will take precedence" >&5
13176
+echo "$as_me: WARNING: check.h: in the future, the compiler will take precedence" >&2;}
13177 13177
     ( cat <<\_ASBOX
13178 13178
 ## -------------------------------------- ##
13179 13179
 ## Report this to http://bugs.clamav.net/ ##
... ...
@@ -13182,28 +13184,20 @@ _ASBOX
13182 13182
      ) | sed "s/^/$as_me: WARNING:     /" >&2
13183 13183
     ;;
13184 13184
 esac
13185
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
13186
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
13187
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
13185
+{ echo "$as_me:$LINENO: checking for check.h" >&5
13186
+echo $ECHO_N "checking for check.h... $ECHO_C" >&6; }
13187
+if test "${ac_cv_header_check_h+set}" = set; then
13188 13188
   echo $ECHO_N "(cached) $ECHO_C" >&6
13189 13189
 else
13190
-  eval "$as_ac_Header=\$ac_header_preproc"
13191
-fi
13192
-ac_res=`eval echo '${'$as_ac_Header'}'`
13193
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
13194
-echo "${ECHO_T}$ac_res" >&6; }
13195
-
13190
+  ac_cv_header_check_h=$ac_header_preproc
13196 13191
 fi
13197
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
13198
-  cat >>confdefs.h <<_ACEOF
13199
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13200
-_ACEOF
13192
+{ echo "$as_me:$LINENO: result: $ac_cv_header_check_h" >&5
13193
+echo "${ECHO_T}$ac_cv_header_check_h" >&6; }
13201 13194
 
13202 13195
 fi
13196
+if test $ac_cv_header_check_h = yes; then
13203 13197
 
13204
-done
13205
-
13206
-    { echo "$as_me:$LINENO: checking for srunner_create in -lcheck" >&5
13198
+		{ echo "$as_me:$LINENO: checking for srunner_create in -lcheck" >&5
13207 13199
 echo $ECHO_N "checking for srunner_create in -lcheck... $ECHO_C" >&6; }
13208 13200
 if test "${ac_cv_lib_check_srunner_create+set}" = set; then
13209 13201
   echo $ECHO_N "(cached) $ECHO_C" >&6
... ...
@@ -13265,20 +13259,204 @@ fi
13265 13265
 { echo "$as_me:$LINENO: result: $ac_cv_lib_check_srunner_create" >&5
13266 13266
 echo "${ECHO_T}$ac_cv_lib_check_srunner_create" >&6; }
13267 13267
 if test $ac_cv_lib_check_srunner_create = yes; then
13268
-  LCHECK="-lcheck"
13268
+
13269
+				LCHECK="-lcheck";
13270
+
13271
+cat >>confdefs.h <<\_ACEOF
13272
+#define HAVE_CHECK 1
13273
+_ACEOF
13274
+
13275
+				# Check whether --enable-tests-install was given.
13276
+if test "${enable_tests_install+set}" = set; then
13277
+  enableval=$enable_tests_install; enable_ut_install=$enableval
13278
+else
13279
+  enable_ut_install="no"
13280
+fi
13281
+
13282
+
13283
+else
13284
+  LCHECK="no"
13285
+fi
13286
+
13287
+
13269 13288
 else
13270 13289
   LCHECK="no"
13271 13290
 fi
13272 13291
 
13292
+
13273 13293
 fi
13274 13294
 
13275
-if test "$LCHECK" = "no"; then
13295
+if test "$LCHECK" = "no" -a "$enable_check_ut"="yes"; then
13276 13296
     echo
13277 13297
     echo "   ERROR!  Check was configured, but not found.  Get it from http://check.sf.net/"
13278 13298
     exit 1
13279 13299
 fi
13280 13300
 
13281 13301
 
13302
+# Check whether --enable-coverage was given.
13303
+if test "${enable_coverage+set}" = set; then
13304
+  enableval=$enable_coverage; enable_cov=$enableval
13305
+else
13306
+  enable_cov="no"
13307
+fi
13308
+
13309
+
13310
+if test "x$enable_coverage" = "xyes"; then
13311
+	if test "x$ac_compiler_gnu" != "xyes"; then
13312
+		{ { echo "$as_me:$LINENO: error: coverage testing only works if gcc is used" >&5
13313
+echo "$as_me: error: coverage testing only works if gcc is used" >&2;}
13314
+   { (exit 1); exit 1; }; }
13315
+	fi
13316
+
13317
+	CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
13318
+	LDFLAGS="$LDFLAGS -lgcov"
13319
+fi
13320
+
13321
+ if test "x$enable_coverage" = "xyes"; then
13322
+  ENABLE_COVERAGE_TRUE=
13323
+  ENABLE_COVERAGE_FALSE='#'
13324
+else
13325
+  ENABLE_COVERAGE_TRUE='#'
13326
+  ENABLE_COVERAGE_FALSE=
13327
+fi
13328
+
13329
+ if test "x$enable_ut_install" = "xyes"; then
13330
+  ENABLE_UT_INSTALL_TRUE=
13331
+  ENABLE_UT_INSTALL_FALSE='#'
13332
+else
13333
+  ENABLE_UT_INSTALL_TRUE='#'
13334
+  ENABLE_UT_INSTALL_FALSE=
13335
+fi
13336
+
13337
+for ac_prog in gcov
13338
+do
13339
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
13340
+set dummy $ac_prog; ac_word=$2
13341
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
13342
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
13343
+if test "${ac_cv_prog_GCOV+set}" = set; then
13344
+  echo $ECHO_N "(cached) $ECHO_C" >&6
13345
+else
13346
+  if test -n "$GCOV"; then
13347
+  ac_cv_prog_GCOV="$GCOV" # Let the user override the test.
13348
+else
13349
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13350
+for as_dir in $PATH
13351
+do
13352
+  IFS=$as_save_IFS
13353
+  test -z "$as_dir" && as_dir=.
13354
+  for ac_exec_ext in '' $ac_executable_extensions; do
13355
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13356
+    ac_cv_prog_GCOV="$ac_prog"
13357
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
13358
+    break 2
13359
+  fi
13360
+done
13361
+done
13362
+IFS=$as_save_IFS
13363
+
13364
+fi
13365
+fi
13366
+GCOV=$ac_cv_prog_GCOV
13367
+if test -n "$GCOV"; then
13368
+  { echo "$as_me:$LINENO: result: $GCOV" >&5
13369
+echo "${ECHO_T}$GCOV" >&6; }
13370
+else
13371
+  { echo "$as_me:$LINENO: result: no" >&5
13372
+echo "${ECHO_T}no" >&6; }
13373
+fi
13374
+
13375
+
13376
+  test -n "$GCOV" && break
13377
+done
13378
+test -n "$GCOV" || GCOV="false"
13379
+
13380
+for ac_prog in lcov
13381
+do
13382
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
13383
+set dummy $ac_prog; ac_word=$2
13384
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
13385
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
13386
+if test "${ac_cv_prog_LCOV+set}" = set; then
13387
+  echo $ECHO_N "(cached) $ECHO_C" >&6
13388
+else
13389
+  if test -n "$LCOV"; then
13390
+  ac_cv_prog_LCOV="$LCOV" # Let the user override the test.
13391
+else
13392
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13393
+for as_dir in $PATH
13394
+do
13395
+  IFS=$as_save_IFS
13396
+  test -z "$as_dir" && as_dir=.
13397
+  for ac_exec_ext in '' $ac_executable_extensions; do
13398
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13399
+    ac_cv_prog_LCOV="$ac_prog"
13400
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
13401
+    break 2
13402
+  fi
13403
+done
13404
+done
13405
+IFS=$as_save_IFS
13406
+
13407
+fi
13408
+fi
13409
+LCOV=$ac_cv_prog_LCOV
13410
+if test -n "$LCOV"; then
13411
+  { echo "$as_me:$LINENO: result: $LCOV" >&5
13412
+echo "${ECHO_T}$LCOV" >&6; }
13413
+else
13414
+  { echo "$as_me:$LINENO: result: no" >&5
13415
+echo "${ECHO_T}no" >&6; }
13416
+fi
13417
+
13418
+
13419
+  test -n "$LCOV" && break
13420
+done
13421
+test -n "$LCOV" || LCOV="false"
13422
+
13423
+for ac_prog in genhtml
13424
+do
13425
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
13426
+set dummy $ac_prog; ac_word=$2
13427
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
13428
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
13429
+if test "${ac_cv_prog_GENHTML+set}" = set; then
13430
+  echo $ECHO_N "(cached) $ECHO_C" >&6
13431
+else
13432
+  if test -n "$GENHTML"; then
13433
+  ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test.
13434
+else
13435
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13436
+for as_dir in $PATH
13437
+do
13438
+  IFS=$as_save_IFS
13439
+  test -z "$as_dir" && as_dir=.
13440
+  for ac_exec_ext in '' $ac_executable_extensions; do
13441
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
13442
+    ac_cv_prog_GENHTML="$ac_prog"
13443
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
13444
+    break 2
13445
+  fi
13446
+done
13447
+done
13448
+IFS=$as_save_IFS
13449
+
13450
+fi
13451
+fi
13452
+GENHTML=$ac_cv_prog_GENHTML
13453
+if test -n "$GENHTML"; then
13454
+  { echo "$as_me:$LINENO: result: $GENHTML" >&5
13455
+echo "${ECHO_T}$GENHTML" >&6; }
13456
+else
13457
+  { echo "$as_me:$LINENO: result: no" >&5
13458
+echo "${ECHO_T}no" >&6; }
13459
+fi
13460
+
13461
+
13462
+  test -n "$GENHTML" && break
13463
+done
13464
+test -n "$GENHTML" || GENHTML="false"
13465
+
13282 13466
 
13283 13467
 have_pthreads=no
13284 13468
 if test "${ac_cv_header_pthread_h+set}" = set; then
... ...
@@ -19456,6 +19634,20 @@ echo "$as_me: error: conditional \"VERSIONSCRIPT\" was never defined.
19456 19456
 Usually this means the macro was only invoked conditionally." >&2;}
19457 19457
    { (exit 1); exit 1; }; }
19458 19458
 fi
19459
+if test -z "${ENABLE_COVERAGE_TRUE}" && test -z "${ENABLE_COVERAGE_FALSE}"; then
19460
+  { { echo "$as_me:$LINENO: error: conditional \"ENABLE_COVERAGE\" was never defined.
19461
+Usually this means the macro was only invoked conditionally." >&5
19462
+echo "$as_me: error: conditional \"ENABLE_COVERAGE\" was never defined.
19463
+Usually this means the macro was only invoked conditionally." >&2;}
19464
+   { (exit 1); exit 1; }; }
19465
+fi
19466
+if test -z "${ENABLE_UT_INSTALL_TRUE}" && test -z "${ENABLE_UT_INSTALL_FALSE}"; then
19467
+  { { echo "$as_me:$LINENO: error: conditional \"ENABLE_UT_INSTALL\" was never defined.
19468
+Usually this means the macro was only invoked conditionally." >&5
19469
+echo "$as_me: error: conditional \"ENABLE_UT_INSTALL\" was never defined.
19470
+Usually this means the macro was only invoked conditionally." >&2;}
19471
+   { (exit 1); exit 1; }; }
19472
+fi
19459 19473
 if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
19460 19474
   { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
19461 19475
 Usually this means the macro was only invoked conditionally." >&5
... ...
@@ -20188,6 +20380,13 @@ VERSIONSCRIPT_TRUE!$VERSIONSCRIPT_TRUE$ac_delim
20188 20188
 VERSIONSCRIPT_FALSE!$VERSIONSCRIPT_FALSE$ac_delim
20189 20189
 GPERF!$GPERF$ac_delim
20190 20190
 LCHECK!$LCHECK$ac_delim
20191
+ENABLE_COVERAGE_TRUE!$ENABLE_COVERAGE_TRUE$ac_delim
20192
+ENABLE_COVERAGE_FALSE!$ENABLE_COVERAGE_FALSE$ac_delim
20193
+ENABLE_UT_INSTALL_TRUE!$ENABLE_UT_INSTALL_TRUE$ac_delim
20194
+ENABLE_UT_INSTALL_FALSE!$ENABLE_UT_INSTALL_FALSE$ac_delim
20195
+GCOV!$GCOV$ac_delim
20196
+LCOV!$LCOV$ac_delim
20197
+GENHTML!$GENHTML$ac_delim
20191 20198
 MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
20192 20199
 MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
20193 20200
 MAINT!$MAINT$ac_delim
... ...
@@ -20220,7 +20419,7 @@ LIBOBJS!$LIBOBJS$ac_delim
20220 20220
 LTLIBOBJS!$LTLIBOBJS$ac_delim
20221 20221
 _ACEOF
20222 20222
 
20223
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 37; then
20223
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 44; then
20224 20224
     break
20225 20225
   elif $ac_last_try; then
20226 20226
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
... ...
@@ -317,26 +317,55 @@ AC_CHECK_FUNCS([poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat
317 317
 AC_FUNC_MMAP
318 318
 AC_FUNC_FSEEKO
319 319
 
320
-enable_check_ut=no
320
+enable_check_ut=auto
321
+enable_ut_install=no
321 322
 AC_ARG_ENABLE(check,
322
-[  --enable-check           Enable 'check' unit tests], enable_check_ut=yes, )
323
+[  --enable-check           Enable 'check' unit tests (default=auto)], enable_check_ut=$enableval, enable_check_ut="auto" )
323 324
 
324 325
 LCHECK=""
325 326
 if test "$enable_check_ut" != "no" ; then
326
-dnl    CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
327
-dnl    LDFLAGS="$LDFLAGS -lgcov"
328
-    AC_DEFINE([HAVE_CHECK], 1, [Enable 'check' unit tests])
329
-    AC_CHECK_HEADERS(check.h)
330
-    AC_CHECK_LIB(check, srunner_create, LCHECK="-lcheck", LCHECK="no")
327
+    AC_CHECK_HEADER(check.h,
328
+	[
329
+		AC_CHECK_LIB(check, srunner_create,
330
+			[
331
+				LCHECK="-lcheck";
332
+				AC_DEFINE([HAVE_CHECK], 1, [Enable 'check' unit tests])
333
+				AC_ARG_ENABLE(tests-install,
334
+					      AC_HELP_STRING([--enable-tests-install],
335
+					      [install unit tests
336
+					       @<:@default=no@:>@]),
337
+					       [enable_ut_install=$enableval],[enable_ut_install="no"])
338
+			 ], LCHECK="no")
339
+	],[LCHECK="no"])
331 340
 fi
332 341
 
333
-if test "$LCHECK" = "no"; then
342
+if test "$LCHECK" = "no" -a "$enable_check_ut"="yes"; then
334 343
     echo
335 344
     echo "   ERROR!  Check was configured, but not found.  Get it from http://check.sf.net/"
336 345
     exit 1
337 346
 fi
338 347
 
339 348
 AC_SUBST(LCHECK)
349
+AC_ARG_ENABLE(coverage,
350
+	      AC_HELP_STRING([--enable-coverage],
351
+			     [turn on test coverage
352
+			      @<:@default=no@:>@]),
353
+[enable_cov=$enableval],[enable_cov="no"])
354
+
355
+if test "x$enable_coverage" = "xyes"; then
356
+	if test "x$ac_compiler_gnu" != "xyes"; then
357
+		AC_MSG_ERROR([coverage testing only works if gcc is used])
358
+	fi
359
+
360
+	CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
361
+	LDFLAGS="$LDFLAGS -lgcov"
362
+fi
363
+
364
+AM_CONDITIONAL(ENABLE_COVERAGE, test "x$enable_coverage" = "xyes")
365
+AM_CONDITIONAL(ENABLE_UT_INSTALL, test "x$enable_ut_install" = "xyes")
366
+AC_CHECK_PROGS(GCOV, gcov, false)
367
+AC_CHECK_PROGS(LCOV, lcov, false)
368
+AC_CHECK_PROGS(GENHTML, genhtml, false)
340 369
 
341 370
 have_pthreads=no
342 371
 AC_CHECK_HEADER([pthread.h],[have_pthreads=yes],)
... ...
@@ -95,6 +95,8 @@ ECHO_T = @ECHO_T@
95 95
 EGREP = @EGREP@
96 96
 EXEEXT = @EXEEXT@
97 97
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
98
+GCOV = @GCOV@
99
+GENHTML = @GENHTML@
98 100
 GETENT = @GETENT@
99 101
 GPERF = @GPERF@
100 102
 GREP = @GREP@
... ...
@@ -105,6 +107,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
105 105
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
106 106
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
107 107
 LCHECK = @LCHECK@
108
+LCOV = @LCOV@
108 109
 LDFLAGS = @LDFLAGS@
109 110
 LIBBZ2 = @LIBBZ2@
110 111
 LIBBZ2_PREFIX = @LIBBZ2_PREFIX@
... ...
@@ -100,6 +100,8 @@ ECHO_T = @ECHO_T@
100 100
 EGREP = @EGREP@
101 101
 EXEEXT = @EXEEXT@
102 102
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
103
+GCOV = @GCOV@
104
+GENHTML = @GENHTML@
103 105
 GETENT = @GETENT@
104 106
 GPERF = @GPERF@
105 107
 GREP = @GREP@
... ...
@@ -110,6 +112,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
110 110
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
111 111
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
112 112
 LCHECK = @LCHECK@
113
+LCOV = @LCOV@
113 114
 LDFLAGS = @LDFLAGS@
114 115
 LIBBZ2 = @LIBBZ2@
115 116
 LIBBZ2_PREFIX = @LIBBZ2_PREFIX@
... ...
@@ -93,6 +93,8 @@ ECHO_T = @ECHO_T@
93 93
 EGREP = @EGREP@
94 94
 EXEEXT = @EXEEXT@
95 95
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
96
+GCOV = @GCOV@
97
+GENHTML = @GENHTML@
96 98
 GETENT = @GETENT@
97 99
 GPERF = @GPERF@
98 100
 GREP = @GREP@
... ...
@@ -103,6 +105,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
103 103
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
104 104
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
105 105
 LCHECK = @LCHECK@
106
+LCOV = @LCOV@
106 107
 LDFLAGS = @LDFLAGS@
107 108
 LIBBZ2 = @LIBBZ2@
108 109
 LIBBZ2_PREFIX = @LIBBZ2_PREFIX@
... ...
@@ -121,6 +121,8 @@ ECHO_T = @ECHO_T@
121 121
 EGREP = @EGREP@
122 122
 EXEEXT = @EXEEXT@
123 123
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
124
+GCOV = @GCOV@
125
+GENHTML = @GENHTML@
124 126
 GETENT = @GETENT@
125 127
 GPERF = @GPERF@
126 128
 GREP = @GREP@
... ...
@@ -131,6 +133,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
131 131
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
132 132
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
133 133
 LCHECK = @LCHECK@
134
+LCOV = @LCOV@
134 135
 LDFLAGS = @LDFLAGS@
135 136
 LIBBZ2 = @LIBBZ2@
136 137
 LIBBZ2_PREFIX = @LIBBZ2_PREFIX@
... ...
@@ -164,6 +164,8 @@ ECHO_T = @ECHO_T@
164 164
 EGREP = @EGREP@
165 165
 EXEEXT = @EXEEXT@
166 166
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
167
+GCOV = @GCOV@
168
+GENHTML = @GENHTML@
167 169
 GETENT = @GETENT@
168 170
 GPERF = @GPERF@
169 171
 GREP = @GREP@
... ...
@@ -174,6 +176,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
174 174
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
175 175
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
176 176
 LCHECK = @LCHECK@
177
+LCOV = @LCOV@
177 178
 LDFLAGS = @LDFLAGS@
178 179
 LIBBZ2 = @LIBBZ2@
179 180
 LIBBZ2_PREFIX = @LIBBZ2_PREFIX@
... ...
@@ -113,6 +113,8 @@ ECHO_T = @ECHO_T@
113 113
 EGREP = @EGREP@
114 114
 EXEEXT = @EXEEXT@
115 115
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
116
+GCOV = @GCOV@
117
+GENHTML = @GENHTML@
116 118
 GETENT = @GETENT@
117 119
 GPERF = @GPERF@
118 120
 GREP = @GREP@
... ...
@@ -123,6 +125,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
123 123
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
124 124
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
125 125
 LCHECK = @LCHECK@
126
+LCOV = @LCOV@
126 127
 LDFLAGS = @LDFLAGS@
127 128
 LIBBZ2 = @LIBBZ2@
128 129
 LIBBZ2_PREFIX = @LIBBZ2_PREFIX@
... ...
@@ -117,6 +117,8 @@ ECHO_T = @ECHO_T@
117 117
 EGREP = @EGREP@
118 118
 EXEEXT = @EXEEXT@
119 119
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
120
+GCOV = @GCOV@
121
+GENHTML = @GENHTML@
120 122
 GETENT = @GETENT@
121 123
 GPERF = @GPERF@
122 124
 GREP = @GREP@
... ...
@@ -127,6 +129,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
127 127
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
128 128
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
129 129
 LCHECK = @LCHECK@
130
+LCOV = @LCOV@
130 131
 LDFLAGS = @LDFLAGS@
131 132
 LIBBZ2 = @LIBBZ2@
132 133
 LIBBZ2_PREFIX = @LIBBZ2_PREFIX@
... ...
@@ -112,6 +112,8 @@ ECHO_T = @ECHO_T@
112 112
 EGREP = @EGREP@
113 113
 EXEEXT = @EXEEXT@
114 114
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
115
+GCOV = @GCOV@
116
+GENHTML = @GENHTML@
115 117
 GETENT = @GETENT@
116 118
 GPERF = @GPERF@
117 119
 GREP = @GREP@
... ...
@@ -122,6 +124,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
122 122
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
123 123
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
124 124
 LCHECK = @LCHECK@
125
+LCOV = @LCOV@
125 126
 LDFLAGS = @LDFLAGS@
126 127
 LIBBZ2 = @LIBBZ2@
127 128
 LIBBZ2_PREFIX = @LIBBZ2_PREFIX@
... ...
@@ -120,6 +120,8 @@ ECHO_T = @ECHO_T@
120 120
 EGREP = @EGREP@
121 121
 EXEEXT = @EXEEXT@
122 122
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
123
+GCOV = @GCOV@
124
+GENHTML = @GENHTML@
123 125
 GETENT = @GETENT@
124 126
 GPERF = @GPERF@
125 127
 GREP = @GREP@
... ...
@@ -130,6 +132,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
130 130
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
131 131
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
132 132
 LCHECK = @LCHECK@
133
+LCOV = @LCOV@
133 134
 LDFLAGS = @LDFLAGS@
134 135
 LIBBZ2 = @LIBBZ2@
135 136
 LIBBZ2_PREFIX = @LIBBZ2_PREFIX@
... ...
@@ -75,6 +75,8 @@ ECHO_T = @ECHO_T@
75 75
 EGREP = @EGREP@
76 76
 EXEEXT = @EXEEXT@
77 77
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
78
+GCOV = @GCOV@
79
+GENHTML = @GENHTML@
78 80
 GETENT = @GETENT@
79 81
 GPERF = @GPERF@
80 82
 GREP = @GREP@
... ...
@@ -85,6 +87,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
85 85
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
86 86
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
87 87
 LCHECK = @LCHECK@
88
+LCOV = @LCOV@
88 89
 LDFLAGS = @LDFLAGS@
89 90
 LIBBZ2 = @LIBBZ2@
90 91
 LIBBZ2_PREFIX = @LIBBZ2_PREFIX@
... ...
@@ -1,5 +1,40 @@
1
-TESTS = check_clamav
2
-bin_PROGRAMS = check_clamav
3
-check_clamav_SOURCES = check_clamav.c check_jsnorm.c check_str.c $(top_builddir)/libclamav/clamav.h
1
+programs = check_clamav
2
+scripts = check_clamd.sh check_freshclam.sh check_sigtool.sh check_clamscan.sh
3
+
4
+TESTS = $(programs) $(scripts)
5
+if ENABLE_UT_INSTALL 
6
+bin_PROGRAMS = $(programs)
7
+dist_bin_SCRIPTS = $(scripts)
8
+else
9
+check_PROGRAMS = $(programs)
10
+check_SCRIPTS = $(scripts)
11
+endif
12
+check_clamav_SOURCES = check_clamav.c check_jsnorm.c check_str.c checks.h $(top_builddir)/libclamav/clamav.h
4 13
 check_clamav_CFLAGS = 
5 14
 check_clamav_LDADD = $(top_builddir)/libclamav/libclamav.la @THREAD_LIBS@ @LCHECK@
15
+
16
+LCOV_OUTPUT = lcov.out
17
+LCOV_HTML = lcov_html
18
+LCOV_LCOV = @LCOV@
19
+LCOV_GENHTML = @GENHTML@
20
+CLEANFILES=lcov.out *.gcno *.gcda *.log
21
+EXTRA_DIST=test-clamd.conf test-freshclam.conf
22
+lcov: $(LCOV_HTML)
23
+
24
+DIRECTORIES=--directory . --directory ../libclamav --directory ../clamd --directory ../freshclam --directory ../sigtool --directory ../clamscan --directory ../clamdscan
25
+.libs/check_clamav.gcda: $(TESTS)
26
+	lcov $(DIRECTORIES) --zerocounters
27
+	@$(MAKE) check
28
+
29
+$(LCOV_OUTPUT): .libs/check_clamav.gcda
30
+	$(LCOV_LCOV) --capture $(DIRECTORIES) --base-directory . --output-file $@
31
+
32
+$(LCOV_HTML): $(LCOV_OUTPUT)
33
+	-$(RM) -r $@
34
+	LANG=C $(LCOV_GENHTML) --output-directory $@ --title "ClamAV Code Coverage" --show-details $<
35
+	@echo "Open `pwd`/$(LCOV_HTML)/index.html in a browser."
36
+
37
+clean-local: lcov-clean
38
+.PHONY: lcov-clean
39
+lcov-clean:
40
+	-$(RM) -r $(LCOV_HTML) $(LCOV_OUTPUT)
... ...
@@ -14,6 +14,7 @@
14 14
 
15 15
 @SET_MAKE@
16 16
 
17
+
17 18
 VPATH = @srcdir@
18 19
 pkgdatadir = $(datadir)/@PACKAGE@
19 20
 pkglibdir = $(libdir)/@PACKAGE@
... ...
@@ -33,10 +34,12 @@ POST_UNINSTALL = :
33 33
 build_triplet = @build@
34 34
 host_triplet = @host@
35 35
 target_triplet = @target@
36
-TESTS = check_clamav$(EXEEXT)
37
-bin_PROGRAMS = check_clamav$(EXEEXT)
36
+TESTS = $(am__EXEEXT_1) $(scripts)
37
+@ENABLE_UT_INSTALL_TRUE@bin_PROGRAMS = $(am__EXEEXT_1)
38
+@ENABLE_UT_INSTALL_FALSE@check_PROGRAMS = $(am__EXEEXT_1)
38 39
 subdir = unit_tests
39
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
40
+DIST_COMMON = $(am__dist_bin_SCRIPTS_DIST) $(srcdir)/Makefile.am \
41
+	$(srcdir)/Makefile.in
40 42
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
41 43
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
42 44
 	$(top_srcdir)/m4/fdpassing.m4 $(top_srcdir)/m4/lib-link.m4 \
... ...
@@ -46,7 +49,8 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
46 46
 mkinstalldirs = $(install_sh) -d
47 47
 CONFIG_HEADER = $(top_builddir)/clamav-config.h
48 48
 CONFIG_CLEAN_FILES =
49
-am__installdirs = "$(DESTDIR)$(bindir)"
49
+am__EXEEXT_1 = check_clamav$(EXEEXT)
50
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
50 51
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
51 52
 PROGRAMS = $(bin_PROGRAMS)
52 53
 am_check_clamav_OBJECTS = check_clamav-check_clamav.$(OBJEXT) \
... ...
@@ -57,6 +61,10 @@ check_clamav_DEPENDENCIES = $(top_builddir)/libclamav/libclamav.la
57 57
 check_clamav_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
58 58
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(check_clamav_CFLAGS) \
59 59
 	$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
60
+am__dist_bin_SCRIPTS_DIST = check_clamd.sh check_freshclam.sh \
61
+	check_sigtool.sh check_clamscan.sh
62
+dist_binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
63
+SCRIPTS = $(dist_bin_SCRIPTS)
60 64
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
61 65
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
62 66
 am__depfiles_maybe = depfiles
... ...
@@ -103,6 +111,8 @@ ECHO_T = @ECHO_T@
103 103
 EGREP = @EGREP@
104 104
 EXEEXT = @EXEEXT@
105 105
 FRESHCLAM_LIBS = @FRESHCLAM_LIBS@
106
+GCOV = @GCOV@
107
+GENHTML = @GENHTML@
106 108
 GETENT = @GETENT@
107 109
 GPERF = @GPERF@
108 110
 GREP = @GREP@
... ...
@@ -113,6 +123,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
113 113
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
114 114
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
115 115
 LCHECK = @LCHECK@
116
+LCOV = @LCOV@
116 117
 LDFLAGS = @LDFLAGS@
117 118
 LIBBZ2 = @LIBBZ2@
118 119
 LIBBZ2_PREFIX = @LIBBZ2_PREFIX@
... ...
@@ -202,9 +213,20 @@ target_os = @target_os@
202 202
 target_vendor = @target_vendor@
203 203
 top_builddir = @top_builddir@
204 204
 top_srcdir = @top_srcdir@
205
-check_clamav_SOURCES = check_clamav.c check_jsnorm.c check_str.c $(top_builddir)/libclamav/clamav.h
205
+programs = check_clamav
206
+scripts = check_clamd.sh check_freshclam.sh check_sigtool.sh check_clamscan.sh
207
+@ENABLE_UT_INSTALL_TRUE@dist_bin_SCRIPTS = $(scripts)
208
+@ENABLE_UT_INSTALL_FALSE@check_SCRIPTS = $(scripts)
209
+check_clamav_SOURCES = check_clamav.c check_jsnorm.c check_str.c checks.h $(top_builddir)/libclamav/clamav.h
206 210
 check_clamav_CFLAGS = 
207 211
 check_clamav_LDADD = $(top_builddir)/libclamav/libclamav.la @THREAD_LIBS@ @LCHECK@
212
+LCOV_OUTPUT = lcov.out
213
+LCOV_HTML = lcov_html
214
+LCOV_LCOV = @LCOV@
215
+LCOV_GENHTML = @GENHTML@
216
+CLEANFILES = lcov.out *.gcno *.gcda *.log
217
+EXTRA_DIST = test-clamd.conf test-freshclam.conf
218
+DIRECTORIES = --directory . --directory ../libclamav --directory ../clamd --directory ../freshclam --directory ../sigtool --directory ../clamscan --directory ../clamdscan
208 219
 all: all-am
209 220
 
210 221
 .SUFFIXES:
... ...
@@ -266,9 +288,35 @@ clean-binPROGRAMS:
266 266
 	  echo " rm -f $$p $$f"; \
267 267
 	  rm -f $$p $$f ; \
268 268
 	done
269
+
270
+clean-checkPROGRAMS:
271
+	@list='$(check_PROGRAMS)'; for p in $$list; do \
272
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
273
+	  echo " rm -f $$p $$f"; \
274
+	  rm -f $$p $$f ; \
275
+	done
269 276
 check_clamav$(EXEEXT): $(check_clamav_OBJECTS) $(check_clamav_DEPENDENCIES) 
270 277
 	@rm -f check_clamav$(EXEEXT)
271 278
 	$(check_clamav_LINK) $(check_clamav_OBJECTS) $(check_clamav_LDADD) $(LIBS)
279
+install-dist_binSCRIPTS: $(dist_bin_SCRIPTS)
280
+	@$(NORMAL_INSTALL)
281
+	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
282
+	@list='$(dist_bin_SCRIPTS)'; for p in $$list; do \
283
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
284
+	  if test -f $$d$$p; then \
285
+	    f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
286
+	    echo " $(dist_binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
287
+	    $(dist_binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
288
+	  else :; fi; \
289
+	done
290
+
291
+uninstall-dist_binSCRIPTS:
292
+	@$(NORMAL_UNINSTALL)
293
+	@list='$(dist_bin_SCRIPTS)'; for p in $$list; do \
294
+	  f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
295
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
296
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
297
+	done
272 298
 
273 299
 mostlyclean-compile:
274 300
 	-rm -f *.$(OBJEXT)
... ...
@@ -496,11 +544,12 @@ distdir: $(DISTFILES)
496 496
 	  fi; \
497 497
 	done
498 498
 check-am: all-am
499
+	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS)
499 500
 	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
500 501
 check: check-am
501
-all-am: Makefile $(PROGRAMS)
502
+all-am: Makefile $(PROGRAMS) $(SCRIPTS)
502 503
 installdirs:
503
-	for dir in "$(DESTDIR)$(bindir)"; do \
504
+	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \
504 505
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
505 506
 	done
506 507
 install: install-am
... ...
@@ -520,6 +569,7 @@ install-strip:
520 520
 mostlyclean-generic:
521 521
 
522 522
 clean-generic:
523
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
523 524
 
524 525
 distclean-generic:
525 526
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
... ...
@@ -529,7 +579,8 @@ maintainer-clean-generic:
529 529
 	@echo "it deletes files that may require special tools to rebuild."
530 530
 clean: clean-am
531 531
 
532
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
532
+clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
533
+	clean-libtool clean-local mostlyclean-am
533 534
 
534 535
 distclean: distclean-am
535 536
 	-rm -rf ./$(DEPDIR)
... ...
@@ -551,7 +602,7 @@ install-data-am:
551 551
 
552 552
 install-dvi: install-dvi-am
553 553
 
554
-install-exec-am: install-binPROGRAMS
554
+install-exec-am: install-binPROGRAMS install-dist_binSCRIPTS
555 555
 
556 556
 install-html: install-html-am
557 557
 
... ...
@@ -583,24 +634,43 @@ ps: ps-am
583 583
 
584 584
 ps-am:
585 585
 
586
-uninstall-am: uninstall-binPROGRAMS
586
+uninstall-am: uninstall-binPROGRAMS uninstall-dist_binSCRIPTS
587 587
 
588 588
 .MAKE: install-am install-strip
589 589
 
590 590
 .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
591
-	clean-binPROGRAMS clean-generic clean-libtool ctags distclean \
592
-	distclean-compile distclean-generic distclean-libtool \
593
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
594
-	install install-am install-binPROGRAMS install-data \
595
-	install-data-am install-dvi install-dvi-am install-exec \
596
-	install-exec-am install-html install-html-am install-info \
597
-	install-info-am install-man install-pdf install-pdf-am \
598
-	install-ps install-ps-am install-strip installcheck \
599
-	installcheck-am installdirs maintainer-clean \
591
+	clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
592
+	clean-libtool clean-local ctags distclean distclean-compile \
593
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
594
+	dvi-am html html-am info info-am install install-am \
595
+	install-binPROGRAMS install-data install-data-am \
596
+	install-dist_binSCRIPTS install-dvi install-dvi-am \
597
+	install-exec install-exec-am install-html install-html-am \
598
+	install-info install-info-am install-man install-pdf \
599
+	install-pdf-am install-ps install-ps-am install-strip \
600
+	installcheck installcheck-am installdirs maintainer-clean \
600 601
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
601 602
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
602
-	tags uninstall uninstall-am uninstall-binPROGRAMS
603
-
603
+	tags uninstall uninstall-am uninstall-binPROGRAMS \
604
+	uninstall-dist_binSCRIPTS
605
+
606
+lcov: $(LCOV_HTML)
607
+.libs/check_clamav.gcda: $(TESTS)
608
+	lcov $(DIRECTORIES) --zerocounters
609
+	@$(MAKE) check
610
+
611
+$(LCOV_OUTPUT): .libs/check_clamav.gcda
612
+	$(LCOV_LCOV) --capture $(DIRECTORIES) --base-directory . --output-file $@
613
+
614
+$(LCOV_HTML): $(LCOV_OUTPUT)
615
+	-$(RM) -r $@
616
+	LANG=C $(LCOV_GENHTML) --output-directory $@ --title "ClamAV Code Coverage" --show-details $<
617
+	@echo "Open `pwd`/$(LCOV_HTML)/index.html in a browser."
618
+
619
+clean-local: lcov-clean
620
+.PHONY: lcov-clean
621
+lcov-clean:
622
+	-$(RM) -r $(LCOV_HTML) $(LCOV_OUTPUT)
604 623
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
605 624
 # Otherwise a system limit (for SysV at least) may be exceeded.
606 625
 .NOEXPORT:
607 626
new file mode 100755
... ...
@@ -0,0 +1,29 @@
0
+#!/bin/sh
1
+function die() {
2
+	test /tmp/clamd-test.pid && kill `cat /tmp/clamd-test.pid` 
3
+	rm -r test-db
4
+	exit $1
5
+}
6
+
7
+mkdir -p test-db
8
+cat <<EOF >test-db/test.hdb
9
+aa15bcf478d165efd2065190eb473bcb:544:ClamAV-Test-File
10
+EOF
11
+
12
+FILES=../test/clam*
13
+../clamd/clamd -c $srcdir/test-clamd.conf || { echo "Failed to start clamd!" >&2; die 1;}
14
+rm -f clamdscan.log
15
+../clamdscan/clamdscan --version --config-file $srcdir/test-clamd.conf 2>&1|grep "^ClamAV" >/dev/null || { echo "clamdscan can't get version of clamd!" >&2; die 2;}
16
+../clamdscan/clamdscan --quiet --config-file $srcdir/test-clamd.conf $FILES --log=clamdscan.log
17
+if test $? = 2; then 
18
+	echo "Failed to run clamdscan!" >&2;
19
+	die 3;
20
+fi
21
+NFILES=`ls -1 $FILES | wc -l`
22
+NINFECTED=`grep "Infected files" clamdscan.log | cut -f2 -d:`
23
+if test "$NFILES" != "$NINFECTED"; then
24
+	echo "clamd did not detect all testfiles correctly!" >&2;
25
+	grep OK clamdscan.log >&2;
26
+	die 4;
27
+fi
28
+die 0;
0 29
new file mode 100755
... ...
@@ -0,0 +1,12 @@
0
+#!/bin/sh
1
+mkdir test-db
2
+cat <<EOF >test-db/test.hdb
3
+aa15bcf478d165efd2065190eb473bcb:544:ClamAV-Test-File
4
+EOF
5
+../clamscan/clamscan --quiet -dtest-db/test.hdb ../test/clam* --log=clamscan.log
6
+if test $? != 1; then
7
+	echo "Error running clamscan: $?" >&2;
8
+	grep OK clamscan.log >&2;
9
+	exit 1;
10
+fi
11
+exit 0;
0 12
new file mode 100755
... ...
@@ -0,0 +1,2 @@
0
+#!/bin/sh
1
+../freshclam/freshclam --config-file=$srcdir/test-freshclam.conf -V >/dev/null
0 2
new file mode 100755
... ...
@@ -0,0 +1,2 @@
0
+#!/bin/sh
1
+../sigtool/sigtool -V >/dev/null
0 2
new file mode 100644
... ...
@@ -0,0 +1,9 @@
0
+LogFile /tmp/clamd-test.log
1
+LogTime yes
2
+LogClean yes
3
+LogVerbose yes
4
+PidFile /tmp/clamd-test.pid
5
+DatabaseDirectory test-db
6
+LocalSocket clamd-test.socket
7
+ExitOnOOM yes
8
+DetectPUA yes
0 9
new file mode 100644
... ...
@@ -0,0 +1,143 @@
0
+##
1
+## Example config file for freshclam
2
+## Please read the freshclam.conf(5) manual before editing this file.
3
+##
4
+
5
+
6
+# Comment or remove the line below.
7
+#Example
8
+
9
+# Path to the database directory.
10
+# WARNING: It must match clamd.conf's directive!
11
+# Default: hardcoded (depends on installation options)
12
+#DatabaseDirectory /var/lib/clamav
13
+
14
+# Path to the log file (make sure it has proper permissions)
15
+# Default: disabled
16
+#UpdateLogFile /var/log/freshclam.log
17
+
18
+# Maximum size of the log file.
19
+# Value of 0 disables the limit.
20
+# You may use 'M' or 'm' for megabytes (1M = 1m = 1048576 bytes)
21
+# and 'K' or 'k' for kilobytes (1K = 1k = 1024 bytes).
22
+# in bytes just don't use modifiers.
23
+# Default: 1M
24
+#LogFileMaxSize 2M
25
+
26
+# Log time with each message.
27
+# Default: no
28
+#LogTime yes
29
+
30
+# Enable verbose logging.
31
+# Default: no
32
+#LogVerbose yes
33
+
34
+# Use system logger (can work together with UpdateLogFile).
35
+# Default: no
36
+#LogSyslog yes
37
+
38
+# Specify the type of syslog messages - please refer to 'man syslog'
39
+# for facility names.
40
+# Default: LOG_LOCAL6
41
+#LogFacility LOG_MAIL
42
+
43
+# This option allows you to save the process identifier of the daemon
44
+# Default: disabled
45
+#PidFile /var/run/freshclam.pid
46
+
47
+# By default when started freshclam drops privileges and switches to the
48
+# "clamav" user. This directive allows you to change the database owner.
49
+# Default: clamav (may depend on installation options)
50
+#DatabaseOwner clamav
51
+
52
+# Initialize supplementary group access (freshclam must be started by root).
53
+# Default: no
54
+#AllowSupplementaryGroups yes
55
+
56
+# Use DNS to verify virus database version. Freshclam uses DNS TXT records
57
+# to verify database and software versions. With this directive you can change
58
+# the database verification domain.
59
+# WARNING: Do not touch it unless you're configuring freshclam to use your
60
+# own database verification domain.
61
+# Default: current.cvd.clamav.net
62
+#DNSDatabaseInfo current.cvd.clamav.net
63
+
64
+# Uncomment the following line and replace XY with your country
65
+# code. See http://www.iana.org/cctld/cctld-whois.htm for the full list.
66
+#DatabaseMirror db.XY.clamav.net
67
+
68
+# database.clamav.net is a round-robin record which points to our most 
69
+# reliable mirrors. It's used as a fall back in case db.XY.clamav.net is 
70
+# not working. DO NOT TOUCH the following line unless you know what you
71
+# are doing.
72
+DatabaseMirror database.clamav.net
73
+
74
+# How many attempts to make before giving up.
75
+# Default: 3 (per mirror)
76
+#MaxAttempts 5
77
+
78
+# With this option you can control scripted updates. It's highly recommended
79
+# to keep it enabled.
80
+# Default: yes
81
+#ScriptedUpdates yes
82
+
83
+# By default freshclam will keep the local databases (.cld) uncompressed to
84
+# make their handling faster. With this option you can enable the compression;
85
+# the change will take effect with the next database update.
86
+# Default: no
87
+#CompressLocalDatabase no
88
+
89
+# Number of database checks per day.
90
+# Default: 12 (every two hours)
91
+#Checks 24
92
+
93
+# Proxy settings
94
+# Default: disabled
95
+#HTTPProxyServer myproxy.com
96
+#HTTPProxyPort 1234
97
+#HTTPProxyUsername myusername
98
+#HTTPProxyPassword mypass
99
+
100
+# If your servers are behind a firewall/proxy which applies User-Agent
101
+# filtering you can use this option to force the use of a different
102
+# User-Agent header.
103
+# Default: clamav/version_number
104
+#HTTPUserAgent SomeUserAgentIdString
105
+
106
+# Use aaa.bbb.ccc.ddd as client address for downloading databases. Useful for
107
+# multi-homed systems.
108
+# Default: Use OS'es default outgoing IP address.
109
+#LocalIPAddress aaa.bbb.ccc.ddd
110
+
111
+# Send the RELOAD command to clamd.
112
+# Default: no
113
+#NotifyClamd /path/to/clamd.conf
114
+
115
+# Run command after successful database update.
116
+# Default: disabled
117
+#OnUpdateExecute command
118
+
119
+# Run command when database update process fails.
120
+# Default: disabled
121
+#OnErrorExecute command
122
+
123
+# Run command when freshclam reports outdated version.
124
+# In the command string %v will be replaced by the new version number.
125
+# Default: disabled
126
+#OnOutdatedExecute command
127
+
128
+# Don't fork into background.
129
+# Default: no
130
+#Foreground yes
131
+
132
+# Enable debug messages in libclamav.
133
+# Default: no
134
+#Debug yes
135
+
136
+# Timeout in seconds when connecting to database server.
137
+# Default: 30
138
+#ConnectTimeout 60
139
+
140
+# Timeout in seconds when reading from database server.
141
+# Default: 30
142
+#ReceiveTimeout 60