Browse Source

Various logger enhancement

Yann Weber 4 years ago
parent
commit
cba3553bbc
5 changed files with 173 additions and 962 deletions
  1. 18
    0
      include/logger.h
  2. 125
    28
      src/logger.c
  3. 3
    0
      tests/Makefile.am
  4. 0
    931
      tests/Makefile.in
  5. 27
    3
      tests/check_logger.c

+ 18
- 0
include/logger.h View File

@@ -127,6 +127,7 @@
127 127
  * @ingroup cong_logger_flags */
128 128
 #define PYFCGI_LOG_FEXIT_ONFAIL 4
129 129
 
130
+#define PYFCGI_LOGGER_FMT_DEFAULT "{datetime} {ident} {level}({pid}) {msg}"
130 131
 #define PYFCGI_LOGGER_TIME_FMT_DEFAULT "%F %T%z"
131 132
 
132 133
 
@@ -286,6 +287,14 @@ struct pyfcgi_conf_logger_s
286 287
 /**@brief Initiliaze logger conf */
287 288
 int pyfcgi_logger_init();
288 289
 
290
+/**@brief Stop & free the logger
291
+ * @note also free formats
292
+ */
293
+int pyfcgi_logger_stop();
294
+
295
+/**@brief Stop & free an individual logger */
296
+void _pyfcgi_logger_free(pyfcgi_logger_t*);
297
+
289 298
 /**@brief Add a new logger
290 299
  * @param char* filename
291 300
  * @param logmask_t loglvl a mask indicating wich loglevels should be logged
@@ -309,6 +318,15 @@ int pyfcgi_logger_format_add(const char*, size_t*);
309 318
  */
310 319
 int pyfcgi_logger_parse_format(const char*, pyfcgi_logger_format_t*);
311 320
 
321
+/**@brief Initialize a pyfcgi_logger_format_t.buf attribute (to init the
322
+ * prefix & sufix attributes.
323
+ * @note have to be called when ident is updated
324
+ * @param pyfcgi_logger_format_t* fmt
325
+ * @note called by @ref pyfcgi_logger_add_format but should be called
326
+ * by @ref pyfcgi_logger_parse_format
327
+ */
328
+int pyfcgi_logger_format_bufinit(pyfcgi_logger_format_t*);
329
+
312 330
 /**@brief Parse a field string and populate corresponding
313 331
  * @ret struct pyfcgi_logger_field_s
314 332
  * @param const char ** ptr on current format pointer

+ 125
- 28
src/logger.c View File

@@ -8,15 +8,42 @@ int pyfcgi_logger_init()
8 8
 	return 0;
9 9
 }
10 10
 
11
+int pyfcgi_logger_stop()
12
+{
13
+	pyfcgi_conf_logger_t *conf;
14
+	pyfcgi_logger_format_t *fmt;
15
+	size_t i, j;
16
+
17
+	conf = &PyFCGI_conf.logs;
18
+	for(i=0; i<conf->logger_sz; i++)
19
+	{
20
+		_pyfcgi_logger_free(&(conf->loggers[i]));
21
+	}
22
+	for(i=0; i<conf->format_sz; i++)
23
+	{
24
+		fmt = &(conf->formats[i]);
25
+		for(j=0; j<fmt->nfield; j++)
26
+		{
27
+			pyfcgi_logger_field_free(&(fmt->fields[j]));
28
+		}
29
+		free(conf->formats[i].buf);
30
+	}
31
+	
32
+	return 0;
33
+}
34
+
35
+void _pyfcgi_logger_free(pyfcgi_logger_t *logger)
36
+{
37
+	free(logger->filename);
38
+}
39
+
11 40
 int pyfcgi_logger_add(const char *filename, logmask_t loglvl, logmask_t logtyp,
12 41
                       const char *format)
13 42
 {
14 43
 	pyfcgi_conf_logger_t *conf;
15 44
 	pyfcgi_logger_t logger;
16 45
 	size_t new_idx;
17
-	void *tmp;
18 46
 	int err;
19
-	char *err_fmt;
20 47
 
21 48
 	conf = &PyFCGI_conf.logs;
22 49
 
@@ -30,48 +57,37 @@ int pyfcgi_logger_add(const char *filename, logmask_t loglvl, logmask_t logtyp,
30 57
 	{
31 58
 		return PYFCGI_FATAL;
32 59
 	}
33
-	if(!logger.filename)
34
-	{
35
-		err = errno;
36
-		err_fmt = "Unable to duplicate logger filename : %s";
37
-		goto err;
38
-	}
39 60
 
40 61
 	logger.loglvl = loglvl;
41 62
 	logger.logtyp = logtyp;
42 63
 	logger.filename = strdup(filename);
43
-
44
-	new_idx = conf->logger_sz;
45
-	conf->logger_sz++;
46
-	if( !(tmp = realloc(conf->loggers,
47
-	                    sizeof(pyfcgi_logger_t) * conf->logger_sz)) )
64
+	if(!logger.filename)
48 65
 	{
49 66
 		err = errno;
50
-		err_fmt = "Unable to realloc loggers array : %s";
51
-		goto err_free_filename;
67
+		pyfcgi_log(LOG_ALERT,
68
+			"Unable to duplicate logger filename : %s",
69
+			strerror(err));
70
+		return PYFCGI_FATAL;	
52 71
 	}
72
+
73
+	new_idx = conf->logger_sz;
74
+	conf->logger_sz++;
53 75
 	conf->loggers[new_idx] = logger;
76
+	pyfcgi_logger_open(&(conf->loggers[new_idx]));
54 77
 	return 0;
55
-
56
-err_free_filename:
57
-	free(logger.filename);
58
-err:
59
-	pyfcgi_log(LOG_ALERT,
60
-	           err_fmt,
61
-		   strerror(err));
62
-	return PYFCGI_FATAL;	
63 78
 }
64 79
 
65 80
 int pyfcgi_logger_format_add(const char* format, size_t* idx)
66 81
 {
67 82
 	size_t i;
68 83
 	pyfcgi_conf_logger_t *conf;
84
+	int ret;
69 85
 
70 86
 	conf = &PyFCGI_conf.logs;
71 87
 
72 88
 	if(!format)
73 89
 	{
74
-		format = PYFCGI_LOGGER_TIME_FMT_DEFAULT;
90
+		format = PYFCGI_LOGGER_FMT_DEFAULT;
75 91
 	}
76 92
 
77 93
 	for(i=0; i<conf->format_sz; i++)
@@ -84,7 +100,11 @@ int pyfcgi_logger_format_add(const char* format, size_t* idx)
84 100
 		return 0;
85 101
 	}
86 102
 	conf->format_sz++;
87
-	return pyfcgi_logger_parse_format(format, &(conf->formats[i]));
103
+	if( !(ret = pyfcgi_logger_parse_format(format, &(conf->formats[i]))) )
104
+	{ // No error, allocating format buffer
105
+		pyfcgi_logger_format_bufinit(&(conf->formats[i]));
106
+	}
107
+	return ret;
88 108
 }
89 109
 
90 110
 int pyfcgi_logger_parse_format(const char* fmt,
@@ -172,6 +192,80 @@ exit_err:
172 192
 	return PYFCGI_ERR;
173 193
 }
174 194
 
195
+int pyfcgi_logger_format_bufinit(pyfcgi_logger_format_t* fmt)
196
+{
197
+	unsigned short i;
198
+	size_t pre_sz, suf_sz;
199
+	char *cur;
200
+	fmt->buf = fmt->prefix = fmt->suffix = NULL;
201
+	if(!fmt || !fmt->nfield)
202
+	{
203
+		return 1;
204
+	}
205
+	if(fmt->nfield == 1 && fmt->fields[0].type == pyfcgi_logger_field_msg)
206
+	{
207
+		// no other field than message, buf, prefix & suffix are NULL
208
+		return 0;
209
+	}
210
+	if(fmt->buf)
211
+	{ // if it is not the first call
212
+		free(fmt->buf);
213
+	}
214
+
215
+	i = 0;
216
+	pre_sz = 0;
217
+	while(i<fmt->nfield && fmt->fields[i].type != pyfcgi_logger_field_msg)
218
+	{
219
+		pre_sz+=fmt->fields[i].len;
220
+		i++;
221
+	}
222
+	i++;
223
+	suf_sz = 0;
224
+	while(i<fmt->nfield && fmt->fields[i].type != pyfcgi_logger_field_msg)
225
+	{
226
+		suf_sz+=fmt->fields[i].len;
227
+		i++;
228
+	}
229
+	pre_sz += pre_sz?1:0;
230
+	suf_sz += suf_sz?1:0;
231
+	fmt->buf = malloc(sizeof(char) * (pre_sz + suf_sz));
232
+	if(!fmt->buf)
233
+	{
234
+		fmt->buf = fmt->prefix = fmt->suffix = NULL;
235
+		pyfcgi_log(LOG_ALERT, "Unable to allocate logger buffer : %s",
236
+		           strerror(errno));
237
+		return PYFCGI_ERR;
238
+	}
239
+	fmt->prefix = pre_sz?fmt->buf:NULL;
240
+	fmt->suffix = suf_sz?(fmt->buf + pre_sz):NULL;
241
+
242
+	i=0;
243
+	cur = fmt->prefix;
244
+	while(i<fmt->nfield)
245
+	{
246
+		while(i<fmt->nfield &&
247
+			fmt->fields[i].type != pyfcgi_logger_field_msg)
248
+		{
249
+			fmt->fields[i].buf_ptr = cur;
250
+			if(fmt->fields[i].len && (
251
+				fmt->fields[i].type == pyfcgi_logger_field_const ||
252
+				fmt->fields[i].type == pyfcgi_logger_field_ident))
253
+			{// copy const fields
254
+				strncpy(cur, fmt->fields[i].val,
255
+					fmt->fields[i].len);
256
+			}
257
+			cur += fmt->fields[i].len;
258
+			i++;
259
+		}
260
+		if(fmt->fields[i].type == pyfcgi_logger_field_msg)
261
+		{
262
+			cur = fmt->suffix;
263
+			i++;
264
+		}
265
+	}
266
+	return 0;
267
+}
268
+
175 269
 int pyfcgi_logger_parse_field(const char** ptr, const char *start,
176 270
                               pyfcgi_logger_fmt_field_t* cur_field,
177 271
 			      char fail_reason[PYFCGI_LOGGER_FMT_PARSE_ERRSZ])
@@ -384,8 +478,8 @@ const char* pyfcgi_logger_value_facility(short typ)
384 478
 
385 479
 int pyfcgi_logger_open(pyfcgi_logger_t *logger)
386 480
 {
387
-	if( (logger->fd = open(logger->filename,
388
-	                       O_WRONLY | O_APPEND | O_CREAT, 00640) < 0) )
481
+	if( ((logger->fd = open(logger->filename,
482
+		O_WRONLY | O_APPEND | O_CREAT, 00640)) < 0) )
389 483
 	{
390 484
 		pyfcgi_log(LOG_ERR,
391 485
 		           "Unable to open log file '%s' : %s",
@@ -411,10 +505,13 @@ int vpyfcgi_log(loglvl_t lvl, const char *fmt, va_list ap)
411 505
 	pyfcgi_conf_logger_t *conf;
412 506
 	unsigned char i;
413 507
 	char buf[512];
508
+	va_list o_ap;
414 509
 
415 510
 	conf = &PyFCGI_conf.logs;
416 511
 
417
-	_vsyslog(lvl, fmt, ap);
512
+	va_copy(o_ap, ap);
513
+	_vsyslog(lvl, fmt, o_ap);
514
+	va_end(o_ap);
418 515
 
419 516
 	len = 0;
420 517
 	if(conf->format_sz > 1)

+ 3
- 0
tests/Makefile.am View File

@@ -3,3 +3,6 @@ check_PROGRAMS = check_logger
3 3
 check_logger_SOURCES = check_logger.c $(top_builddir)/include/logger.h
4 4
 check_logger_CFLAGS = @CHECK_CFLAGS@
5 5
 check_logger_LDADD = $(top_builddir)/src/libpyfcgi.a @CHECK_LIBS@
6
+
7
+clean-local:
8
+	-rm -rf tmp_PyFCGI_checks*

+ 0
- 931
tests/Makefile.in View File

@@ -1,931 +0,0 @@
1
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
2
-# @configure_input@
3
-
4
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
5
-
6
-# This Makefile.in is free software; the Free Software Foundation
7
-# gives unlimited permission to copy and/or distribute it,
8
-# with or without modifications, as long as this notice is preserved.
9
-
10
-# This program is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
-# PARTICULAR PURPOSE.
14
-
15
-@SET_MAKE@
16
-VPATH = @srcdir@
17
-am__is_gnu_make = { \
18
-  if test -z '$(MAKELEVEL)'; then \
19
-    false; \
20
-  elif test -n '$(MAKE_HOST)'; then \
21
-    true; \
22
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
23
-    true; \
24
-  else \
25
-    false; \
26
-  fi; \
27
-}
28
-am__make_running_with_option = \
29
-  case $${target_option-} in \
30
-      ?) ;; \
31
-      *) echo "am__make_running_with_option: internal error: invalid" \
32
-              "target option '$${target_option-}' specified" >&2; \
33
-         exit 1;; \
34
-  esac; \
35
-  has_opt=no; \
36
-  sane_makeflags=$$MAKEFLAGS; \
37
-  if $(am__is_gnu_make); then \
38
-    sane_makeflags=$$MFLAGS; \
39
-  else \
40
-    case $$MAKEFLAGS in \
41
-      *\\[\ \	]*) \
42
-        bs=\\; \
43
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
44
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
45
-    esac; \
46
-  fi; \
47
-  skip_next=no; \
48
-  strip_trailopt () \
49
-  { \
50
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
51
-  }; \
52
-  for flg in $$sane_makeflags; do \
53
-    test $$skip_next = yes && { skip_next=no; continue; }; \
54
-    case $$flg in \
55
-      *=*|--*) continue;; \
56
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
57
-      -*I?*) strip_trailopt 'I';; \
58
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
59
-      -*O?*) strip_trailopt 'O';; \
60
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
61
-      -*l?*) strip_trailopt 'l';; \
62
-      -[dEDm]) skip_next=yes;; \
63
-      -[JT]) skip_next=yes;; \
64
-    esac; \
65
-    case $$flg in \
66
-      *$$target_option*) has_opt=yes; break;; \
67
-    esac; \
68
-  done; \
69
-  test $$has_opt = yes
70
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
71
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
72
-pkgdatadir = $(datadir)/@PACKAGE@
73
-pkgincludedir = $(includedir)/@PACKAGE@
74
-pkglibdir = $(libdir)/@PACKAGE@
75
-pkglibexecdir = $(libexecdir)/@PACKAGE@
76
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
77
-install_sh_DATA = $(install_sh) -c -m 644
78
-install_sh_PROGRAM = $(install_sh) -c
79
-install_sh_SCRIPT = $(install_sh) -c
80
-INSTALL_HEADER = $(INSTALL_DATA)
81
-transform = $(program_transform_name)
82
-NORMAL_INSTALL = :
83
-PRE_INSTALL = :
84
-POST_INSTALL = :
85
-NORMAL_UNINSTALL = :
86
-PRE_UNINSTALL = :
87
-POST_UNINSTALL = :
88
-TESTS = check_logger$(EXEEXT)
89
-check_PROGRAMS = check_logger$(EXEEXT)
90
-subdir = tests
91
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
92
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
93
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
94
-	$(ACLOCAL_M4)
95
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
96
-mkinstalldirs = $(install_sh) -d
97
-CONFIG_HEADER = $(top_builddir)/include/config.h
98
-CONFIG_CLEAN_FILES =
99
-CONFIG_CLEAN_VPATH_FILES =
100
-am_check_logger_OBJECTS = check_logger-check_logger.$(OBJEXT)
101
-check_logger_OBJECTS = $(am_check_logger_OBJECTS)
102
-check_logger_DEPENDENCIES = $(top_builddir)/src/libpyfcgi.a
103
-check_logger_LINK = $(CCLD) $(check_logger_CFLAGS) $(CFLAGS) \
104
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
105
-AM_V_P = $(am__v_P_@AM_V@)
106
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
107
-am__v_P_0 = false
108
-am__v_P_1 = :
109
-AM_V_GEN = $(am__v_GEN_@AM_V@)
110
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
111
-am__v_GEN_0 = @echo "  GEN     " $@;
112
-am__v_GEN_1 = 
113
-AM_V_at = $(am__v_at_@AM_V@)
114
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
115
-am__v_at_0 = @
116
-am__v_at_1 = 
117
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
118
-depcomp = $(SHELL) $(top_srcdir)/depcomp
119
-am__maybe_remake_depfiles = depfiles
120
-am__depfiles_remade = ./$(DEPDIR)/check_logger-check_logger.Po
121
-am__mv = mv -f
122
-AM_V_lt = $(am__v_lt_@AM_V@)
123
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
124
-am__v_lt_0 = --silent
125
-am__v_lt_1 = 
126
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
127
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
128
-AM_V_CC = $(am__v_CC_@AM_V@)
129
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
130
-am__v_CC_0 = @echo "  CC      " $@;
131
-am__v_CC_1 = 
132
-CCLD = $(CC)
133
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
134
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
135
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
136
-am__v_CCLD_0 = @echo "  CCLD    " $@;
137
-am__v_CCLD_1 = 
138
-SOURCES = $(check_logger_SOURCES)
139
-DIST_SOURCES = $(check_logger_SOURCES)
140
-am__can_run_installinfo = \
141
-  case $$AM_UPDATE_INFO_DIR in \
142
-    n|no|NO) false;; \
143
-    *) (install-info --version) >/dev/null 2>&1;; \
144
-  esac
145
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
146
-# Read a list of newline-separated strings from the standard input,
147
-# and print each of them once, without duplicates.  Input order is
148
-# *not* preserved.
149
-am__uniquify_input = $(AWK) '\
150
-  BEGIN { nonempty = 0; } \
151
-  { items[$$0] = 1; nonempty = 1; } \
152
-  END { if (nonempty) { for (i in items) print i; }; } \
153
-'
154
-# Make sure the list of sources is unique.  This is necessary because,
155
-# e.g., the same source file might be shared among _SOURCES variables
156
-# for different programs/libraries.
157
-am__define_uniq_tagged_files = \
158
-  list='$(am__tagged_files)'; \
159
-  unique=`for i in $$list; do \
160
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
161
-  done | $(am__uniquify_input)`
162
-ETAGS = etags
163
-CTAGS = ctags
164
-am__tty_colors_dummy = \
165
-  mgn= red= grn= lgn= blu= brg= std=; \
166
-  am__color_tests=no
167
-am__tty_colors = { \
168
-  $(am__tty_colors_dummy); \
169
-  if test "X$(AM_COLOR_TESTS)" = Xno; then \
170
-    am__color_tests=no; \
171
-  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
172
-    am__color_tests=yes; \
173
-  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
174
-    am__color_tests=yes; \
175
-  fi; \
176
-  if test $$am__color_tests = yes; then \
177
-    red=''; \
178
-    grn=''; \
179
-    lgn=''; \
180
-    blu=''; \
181
-    mgn=''; \
182
-    brg=''; \
183
-    std=''; \
184
-  fi; \
185
-}
186
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
187
-am__vpath_adj = case $$p in \
188
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
189
-    *) f=$$p;; \
190
-  esac;
191
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
192
-am__install_max = 40
193
-am__nobase_strip_setup = \
194
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
195
-am__nobase_strip = \
196
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
197
-am__nobase_list = $(am__nobase_strip_setup); \
198
-  for p in $$list; do echo "$$p $$p"; done | \
199
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
200
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
201
-    if (++n[$$2] == $(am__install_max)) \
202
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
203
-    END { for (dir in files) print dir, files[dir] }'
204
-am__base_list = \
205
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
206
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
207
-am__uninstall_files_from_dir = { \
208
-  test -z "$$files" \
209
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
210
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
211
-         $(am__cd) "$$dir" && rm -f $$files; }; \
212
-  }
213
-am__recheck_rx = ^[ 	]*:recheck:[ 	]*
214
-am__global_test_result_rx = ^[ 	]*:global-test-result:[ 	]*
215
-am__copy_in_global_log_rx = ^[ 	]*:copy-in-global-log:[ 	]*
216
-# A command that, given a newline-separated list of test names on the
217
-# standard input, print the name of the tests that are to be re-run
218
-# upon "make recheck".
219
-am__list_recheck_tests = $(AWK) '{ \
220
-  recheck = 1; \
221
-  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
222
-    { \
223
-      if (rc < 0) \
224
-        { \
225
-          if ((getline line2 < ($$0 ".log")) < 0) \
226
-	    recheck = 0; \
227
-          break; \
228
-        } \
229
-      else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
230
-        { \
231
-          recheck = 0; \
232
-          break; \
233
-        } \
234
-      else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
235
-        { \
236
-          break; \
237
-        } \
238
-    }; \
239
-  if (recheck) \
240
-    print $$0; \
241
-  close ($$0 ".trs"); \
242
-  close ($$0 ".log"); \
243
-}'
244
-# A command that, given a newline-separated list of test names on the
245
-# standard input, create the global log from their .trs and .log files.
246
-am__create_global_log = $(AWK) ' \
247
-function fatal(msg) \
248
-{ \
249
-  print "fatal: making $@: " msg | "cat >&2"; \
250
-  exit 1; \
251
-} \
252
-function rst_section(header) \
253
-{ \
254
-  print header; \
255
-  len = length(header); \
256
-  for (i = 1; i <= len; i = i + 1) \
257
-    printf "="; \
258
-  printf "\n\n"; \
259
-} \
260
-{ \
261
-  copy_in_global_log = 1; \
262
-  global_test_result = "RUN"; \
263
-  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
264
-    { \
265
-      if (rc < 0) \
266
-         fatal("failed to read from " $$0 ".trs"); \
267
-      if (line ~ /$(am__global_test_result_rx)/) \
268
-        { \
269
-          sub("$(am__global_test_result_rx)", "", line); \
270
-          sub("[ 	]*$$", "", line); \
271
-          global_test_result = line; \
272
-        } \
273
-      else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
274
-        copy_in_global_log = 0; \
275
-    }; \
276
-  if (copy_in_global_log) \
277
-    { \
278
-      rst_section(global_test_result ": " $$0); \
279
-      while ((rc = (getline line < ($$0 ".log"))) != 0) \
280
-      { \
281
-        if (rc < 0) \
282
-          fatal("failed to read from " $$0 ".log"); \
283
-        print line; \
284
-      }; \
285
-      printf "\n"; \
286
-    }; \
287
-  close ($$0 ".trs"); \
288
-  close ($$0 ".log"); \
289
-}'
290
-# Restructured Text title.
291
-am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
292
-# Solaris 10 'make', and several other traditional 'make' implementations,
293
-# pass "-e" to $(SHELL), and POSIX 2008 even requires this.  Work around it
294
-# by disabling -e (using the XSI extension "set +e") if it's set.
295
-am__sh_e_setup = case $$- in *e*) set +e;; esac
296
-# Default flags passed to test drivers.
297
-am__common_driver_flags = \
298
-  --color-tests "$$am__color_tests" \
299
-  --enable-hard-errors "$$am__enable_hard_errors" \
300
-  --expect-failure "$$am__expect_failure"
301
-# To be inserted before the command running the test.  Creates the
302
-# directory for the log if needed.  Stores in $dir the directory
303
-# containing $f, in $tst the test, in $log the log.  Executes the
304
-# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
305
-# passes TESTS_ENVIRONMENT.  Set up options for the wrapper that
306
-# will run the test scripts (or their associated LOG_COMPILER, if
307
-# thy have one).
308
-am__check_pre = \
309
-$(am__sh_e_setup);					\
310
-$(am__vpath_adj_setup) $(am__vpath_adj)			\
311
-$(am__tty_colors);					\
312
-srcdir=$(srcdir); export srcdir;			\
313
-case "$@" in						\
314
-  */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;;	\
315
-    *) am__odir=.;; 					\
316
-esac;							\
317
-test "x$$am__odir" = x"." || test -d "$$am__odir" 	\
318
-  || $(MKDIR_P) "$$am__odir" || exit $$?;		\
319
-if test -f "./$$f"; then dir=./;			\
320
-elif test -f "$$f"; then dir=;				\
321
-else dir="$(srcdir)/"; fi;				\
322
-tst=$$dir$$f; log='$@'; 				\
323
-if test -n '$(DISABLE_HARD_ERRORS)'; then		\
324
-  am__enable_hard_errors=no; 				\
325
-else							\
326
-  am__enable_hard_errors=yes; 				\
327
-fi; 							\
328
-case " $(XFAIL_TESTS) " in				\
329
-  *[\ \	]$$f[\ \	]* | *[\ \	]$$dir$$f[\ \	]*) \
330
-    am__expect_failure=yes;;				\
331
-  *)							\
332
-    am__expect_failure=no;;				\
333
-esac; 							\
334
-$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
335
-# A shell command to get the names of the tests scripts with any registered
336
-# extension removed (i.e., equivalently, the names of the test logs, with
337
-# the '.log' extension removed).  The result is saved in the shell variable
338
-# '$bases'.  This honors runtime overriding of TESTS and TEST_LOGS.  Sadly,
339
-# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
340
-# since that might cause problem with VPATH rewrites for suffix-less tests.
341
-# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
342
-am__set_TESTS_bases = \
343
-  bases='$(TEST_LOGS)'; \
344
-  bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
345
-  bases=`echo $$bases`
346
-RECHECK_LOGS = $(TEST_LOGS)
347
-AM_RECURSIVE_TARGETS = check recheck
348
-TEST_SUITE_LOG = test-suite.log
349
-TEST_EXTENSIONS = @EXEEXT@ .test
350
-LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
351
-LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
352
-am__set_b = \
353
-  case '$@' in \
354
-    */*) \
355
-      case '$*' in \
356
-        */*) b='$*';; \
357
-          *) b=`echo '$@' | sed 's/\.log$$//'`; \
358
-       esac;; \
359
-    *) \
360
-      b='$*';; \
361
-  esac
362
-am__test_logs1 = $(TESTS:=.log)
363
-am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
364
-TEST_LOGS = $(am__test_logs2:.test.log=.log)
365
-TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
366
-TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
367
-	$(TEST_LOG_FLAGS)
368
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
369
-	$(top_srcdir)/test-driver
370
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
371
-ACLOCAL = @ACLOCAL@
372
-AMTAR = @AMTAR@
373
-AM_CFLAGS = @AM_CFLAGS@
374
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
375
-AUTOCONF = @AUTOCONF@
376
-AUTOHEADER = @AUTOHEADER@
377
-AUTOMAKE = @AUTOMAKE@
378
-AWK = @AWK@
379
-CC = @CC@
380
-CCDEPMODE = @CCDEPMODE@
381
-CFLAGS = @CFLAGS@
382
-CHECK_CFLAGS = @CHECK_CFLAGS@
383
-CHECK_LIBS = @CHECK_LIBS@
384
-CPP = @CPP@
385
-CPPFLAGS = @CPPFLAGS@
386
-CYGPATH_W = @CYGPATH_W@
387
-DEFS = @DEFS@
388
-DEPDIR = @DEPDIR@
389
-ECHO_C = @ECHO_C@
390
-ECHO_N = @ECHO_N@
391
-ECHO_T = @ECHO_T@
392
-EGREP = @EGREP@
393
-EXEEXT = @EXEEXT@
394
-GREP = @GREP@
395
-INSTALL = @INSTALL@
396
-INSTALL_DATA = @INSTALL_DATA@
397
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
398
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
399
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
400
-LDFLAGS = @LDFLAGS@
401
-LIBOBJS = @LIBOBJS@
402
-LIBS = @LIBS@
403
-LTLIBOBJS = @LTLIBOBJS@
404
-MAKEINFO = @MAKEINFO@
405
-MKDIR_P = @MKDIR_P@
406
-OBJEXT = @OBJEXT@
407
-PACKAGE = @PACKAGE@
408
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
409
-PACKAGE_NAME = @PACKAGE_NAME@
410
-PACKAGE_STRING = @PACKAGE_STRING@
411
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
412
-PACKAGE_URL = @PACKAGE_URL@
413
-PACKAGE_VERSION = @PACKAGE_VERSION@
414
-PATH_SEPARATOR = @PATH_SEPARATOR@
415
-PKG_CONFIG = @PKG_CONFIG@
416
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
417
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
418
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
419
-PYTHON_CONFIG = @PYTHON_CONFIG@
420
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
421
-RANLIB = @RANLIB@
422
-SET_MAKE = @SET_MAKE@
423
-SHELL = @SHELL@
424
-STRIP = @STRIP@
425
-VERSION = @VERSION@
426
-abs_builddir = @abs_builddir@
427
-abs_srcdir = @abs_srcdir@
428
-abs_top_builddir = @abs_top_builddir@
429
-abs_top_srcdir = @abs_top_srcdir@
430
-ac_ct_CC = @ac_ct_CC@
431
-am__include = @am__include@
432
-am__leading_dot = @am__leading_dot@
433
-am__quote = @am__quote@
434
-am__tar = @am__tar@
435
-am__untar = @am__untar@
436
-bindir = @bindir@
437
-build_alias = @build_alias@
438
-builddir = @builddir@
439
-datadir = @datadir@
440
-datarootdir = @datarootdir@
441
-docdir = @docdir@
442
-dvidir = @dvidir@
443
-exec_prefix = @exec_prefix@
444
-host_alias = @host_alias@
445
-htmldir = @htmldir@
446
-includedir = @includedir@
447
-infodir = @infodir@
448
-install_sh = @install_sh@
449
-libdir = @libdir@
450
-libexecdir = @libexecdir@
451
-localedir = @localedir@
452
-localstatedir = @localstatedir@
453
-mandir = @mandir@
454
-mkdir_p = @mkdir_p@
455
-oldincludedir = @oldincludedir@
456
-pdfdir = @pdfdir@
457
-prefix = @prefix@
458
-program_transform_name = @program_transform_name@
459
-psdir = @psdir@
460
-runstatedir = @runstatedir@
461
-sbindir = @sbindir@
462
-sharedstatedir = @sharedstatedir@
463
-srcdir = @srcdir@
464
-sysconfdir = @sysconfdir@
465
-target_alias = @target_alias@
466
-top_build_prefix = @top_build_prefix@
467
-top_builddir = @top_builddir@
468
-top_srcdir = @top_srcdir@
469
-check_logger_SOURCES = check_logger.c $(top_builddir)/include/logger.h
470
-check_logger_CFLAGS = @CHECK_CFLAGS@
471
-check_logger_LDADD = $(top_builddir)/src/libpyfcgi.a @CHECK_LIBS@
472
-all: all-am
473
-
474
-.SUFFIXES:
475
-.SUFFIXES: .c .log .o .obj .test .test$(EXEEXT) .trs
476
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
477
-	@for dep in $?; do \
478
-	  case '$(am__configure_deps)' in \
479
-	    *$$dep*) \
480
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
481
-	        && { if test -f $@; then exit 0; else break; fi; }; \
482
-	      exit 1;; \
483
-	  esac; \
484
-	done; \
485
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
486
-	$(am__cd) $(top_srcdir) && \
487
-	  $(AUTOMAKE) --gnu tests/Makefile
488
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
489
-	@case '$?' in \
490
-	  *config.status*) \
491
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
492
-	  *) \
493
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
494
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
495
-	esac;
496
-
497
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
498
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
499
-
500
-$(top_srcdir)/configure:  $(am__configure_deps)
501
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
502
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
503
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
504
-$(am__aclocal_m4_deps):
505
-
506
-clean-checkPROGRAMS:
507
-	-test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS)
508
-
509
-check_logger$(EXEEXT): $(check_logger_OBJECTS) $(check_logger_DEPENDENCIES) $(EXTRA_check_logger_DEPENDENCIES) 
510
-	@rm -f check_logger$(EXEEXT)
511
-	$(AM_V_CCLD)$(check_logger_LINK) $(check_logger_OBJECTS) $(check_logger_LDADD) $(LIBS)
512
-
513
-mostlyclean-compile:
514
-	-rm -f *.$(OBJEXT)
515
-
516
-distclean-compile:
517
-	-rm -f *.tab.c
518
-
519
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_logger-check_logger.Po@am__quote@ # am--include-marker
520
-
521
-$(am__depfiles_remade):
522
-	@$(MKDIR_P) $(@D)
523
-	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
524
-
525
-am--depfiles: $(am__depfiles_remade)
526
-
527
-.c.o:
528
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
529
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
530
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
531
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
532
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
533
-
534
-.c.obj:
535
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
536
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
537
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
538
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
539
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
540
-
541
-check_logger-check_logger.o: check_logger.c
542
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_logger_CFLAGS) $(CFLAGS) -MT check_logger-check_logger.o -MD -MP -MF $(DEPDIR)/check_logger-check_logger.Tpo -c -o check_logger-check_logger.o `test -f 'check_logger.c' || echo '$(srcdir)/'`check_logger.c
543
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/check_logger-check_logger.Tpo $(DEPDIR)/check_logger-check_logger.Po
544
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='check_logger.c' object='check_logger-check_logger.o' libtool=no @AMDEPBACKSLASH@
545
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
546
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_logger_CFLAGS) $(CFLAGS) -c -o check_logger-check_logger.o `test -f 'check_logger.c' || echo '$(srcdir)/'`check_logger.c
547
-
548
-check_logger-check_logger.obj: check_logger.c
549
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_logger_CFLAGS) $(CFLAGS) -MT check_logger-check_logger.obj -MD -MP -MF $(DEPDIR)/check_logger-check_logger.Tpo -c -o check_logger-check_logger.obj `if test -f 'check_logger.c'; then $(CYGPATH_W) 'check_logger.c'; else $(CYGPATH_W) '$(srcdir)/check_logger.c'; fi`
550
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/check_logger-check_logger.Tpo $(DEPDIR)/check_logger-check_logger.Po
551
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='check_logger.c' object='check_logger-check_logger.obj' libtool=no @AMDEPBACKSLASH@
552
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
553
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_logger_CFLAGS) $(CFLAGS) -c -o check_logger-check_logger.obj `if test -f 'check_logger.c'; then $(CYGPATH_W) 'check_logger.c'; else $(CYGPATH_W) '$(srcdir)/check_logger.c'; fi`
554
-
555
-ID: $(am__tagged_files)
556
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
557
-tags: tags-am
558
-TAGS: tags
559
-
560
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
561
-	set x; \
562
-	here=`pwd`; \
563
-	$(am__define_uniq_tagged_files); \
564
-	shift; \
565
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
566
-	  test -n "$$unique" || unique=$$empty_fix; \
567
-	  if test $$# -gt 0; then \
568
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
569
-	      "$$@" $$unique; \
570
-	  else \
571
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
572
-	      $$unique; \
573
-	  fi; \
574
-	fi
575
-ctags: ctags-am
576
-
577
-CTAGS: ctags
578
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
579
-	$(am__define_uniq_tagged_files); \
580
-	test -z "$(CTAGS_ARGS)$$unique" \
581
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
582
-	     $$unique
583
-
584
-GTAGS:
585
-	here=`$(am__cd) $(top_builddir) && pwd` \
586
-	  && $(am__cd) $(top_srcdir) \
587
-	  && gtags -i $(GTAGS_ARGS) "$$here"
588
-cscopelist: cscopelist-am
589
-
590
-cscopelist-am: $(am__tagged_files)
591
-	list='$(am__tagged_files)'; \
592
-	case "$(srcdir)" in \
593
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
594
-	  *) sdir=$(subdir)/$(srcdir) ;; \
595
-	esac; \
596
-	for i in $$list; do \
597
-	  if test -f "$$i"; then \
598
-	    echo "$(subdir)/$$i"; \
599
-	  else \
600
-	    echo "$$sdir/$$i"; \
601
-	  fi; \
602
-	done >> $(top_builddir)/cscope.files
603
-
604
-distclean-tags:
605
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
606
-
607
-# Recover from deleted '.trs' file; this should ensure that
608
-# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
609
-# both 'foo.log' and 'foo.trs'.  Break the recipe in two subshells
610
-# to avoid problems with "make -n".
611
-.log.trs:
612
-	rm -f $< $@
613
-	$(MAKE) $(AM_MAKEFLAGS) $<
614
-
615
-# Leading 'am--fnord' is there to ensure the list of targets does not
616
-# expand to empty, as could happen e.g. with make check TESTS=''.
617
-am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
618
-am--force-recheck:
619
-	@:
620
-
621
-$(TEST_SUITE_LOG): $(TEST_LOGS)
622
-	@$(am__set_TESTS_bases); \
623
-	am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
624
-	redo_bases=`for i in $$bases; do \
625
-	              am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
626
-	            done`; \
627
-	if test -n "$$redo_bases"; then \
628
-	  redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
629
-	  redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
630
-	  if $(am__make_dryrun); then :; else \
631
-	    rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
632
-	  fi; \
633
-	fi; \
634
-	if test -n "$$am__remaking_logs"; then \
635
-	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
636
-	       "recursion detected" >&2; \
637
-	elif test -n "$$redo_logs"; then \
638
-	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
639
-	fi; \
640
-	if $(am__make_dryrun); then :; else \
641
-	  st=0;  \
642
-	  errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
643
-	  for i in $$redo_bases; do \
644
-	    test -f $$i.trs && test -r $$i.trs \
645
-	      || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
646
-	    test -f $$i.log && test -r $$i.log \
647
-	      || { echo "$$errmsg $$i.log" >&2; st=1; }; \
648
-	  done; \
649
-	  test $$st -eq 0 || exit 1; \
650
-	fi
651
-	@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
652
-	ws='[ 	]'; \
653
-	results=`for b in $$bases; do echo $$b.trs; done`; \
654
-	test -n "$$results" || results=/dev/null; \
655
-	all=`  grep "^$$ws*:test-result:"           $$results | wc -l`; \
656
-	pass=` grep "^$$ws*:test-result:$$ws*PASS"  $$results | wc -l`; \
657
-	fail=` grep "^$$ws*:test-result:$$ws*FAIL"  $$results | wc -l`; \
658
-	skip=` grep "^$$ws*:test-result:$$ws*SKIP"  $$results | wc -l`; \
659
-	xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
660
-	xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
661
-	error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
662
-	if test `expr $$fail + $$xpass + $$error` -eq 0; then \
663
-	  success=true; \
664
-	else \
665
-	  success=false; \
666
-	fi; \
667
-	br='==================='; br=$$br$$br$$br$$br; \
668
-	result_count () \
669
-	{ \
670
-	    if test x"$$1" = x"--maybe-color"; then \
671
-	      maybe_colorize=yes; \
672
-	    elif test x"$$1" = x"--no-color"; then \
673
-	      maybe_colorize=no; \
674
-	    else \
675
-	      echo "$@: invalid 'result_count' usage" >&2; exit 4; \
676
-	    fi; \
677
-	    shift; \
678
-	    desc=$$1 count=$$2; \
679
-	    if test $$maybe_colorize = yes && test $$count -gt 0; then \
680
-	      color_start=$$3 color_end=$$std; \
681
-	    else \
682
-	      color_start= color_end=; \
683
-	    fi; \
684
-	    echo "$${color_start}# $$desc $$count$${color_end}"; \
685
-	}; \
686
-	create_testsuite_report () \
687
-	{ \
688
-	  result_count $$1 "TOTAL:" $$all   "$$brg"; \
689
-	  result_count $$1 "PASS: " $$pass  "$$grn"; \
690
-	  result_count $$1 "SKIP: " $$skip  "$$blu"; \
691
-	  result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
692
-	  result_count $$1 "FAIL: " $$fail  "$$red"; \
693
-	  result_count $$1 "XPASS:" $$xpass "$$red"; \
694
-	  result_count $$1 "ERROR:" $$error "$$mgn"; \
695
-	}; \
696
-	{								\
697
-	  echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |	\
698
-	    $(am__rst_title);						\
699
-	  create_testsuite_report --no-color;				\
700
-	  echo;								\
701
-	  echo ".. contents:: :depth: 2";				\
702
-	  echo;								\
703
-	  for b in $$bases; do echo $$b; done				\
704
-	    | $(am__create_global_log);					\
705
-	} >$(TEST_SUITE_LOG).tmp || exit 1;				\
706
-	mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);			\
707
-	if $$success; then						\
708
-	  col="$$grn";							\
709
-	 else								\
710
-	  col="$$red";							\
711
-	  test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);		\
712
-	fi;								\
713
-	echo "$${col}$$br$${std}"; 					\
714
-	echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}";	\
715
-	echo "$${col}$$br$${std}"; 					\
716
-	create_testsuite_report --maybe-color;				\
717
-	echo "$$col$$br$$std";						\
718
-	if $$success; then :; else					\
719
-	  echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}";		\
720
-	  if test -n "$(PACKAGE_BUGREPORT)"; then			\
721
-	    echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}";	\
722
-	  fi;								\
723
-	  echo "$$col$$br$$std";					\
724
-	fi;								\
725
-	$$success || exit 1
726
-
727
-check-TESTS: $(check_PROGRAMS)
728
-	@list='$(RECHECK_LOGS)';           test -z "$$list" || rm -f $$list
729
-	@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
730
-	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
731
-	@set +e; $(am__set_TESTS_bases); \
732
-	log_list=`for i in $$bases; do echo $$i.log; done`; \
733
-	trs_list=`for i in $$bases; do echo $$i.trs; done`; \
734
-	log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
735
-	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
736
-	exit $$?;
737
-recheck: all $(check_PROGRAMS)
738
-	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
739
-	@set +e; $(am__set_TESTS_bases); \
740
-	bases=`for i in $$bases; do echo $$i; done \
741
-	         | $(am__list_recheck_tests)` || exit 1; \
742
-	log_list=`for i in $$bases; do echo $$i.log; done`; \
743
-	log_list=`echo $$log_list`; \
744
-	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
745
-	        am__force_recheck=am--force-recheck \
746
-	        TEST_LOGS="$$log_list"; \
747
-	exit $$?
748
-check_logger.log: check_logger$(EXEEXT)
749
-	@p='check_logger$(EXEEXT)'; \
750
-	b='check_logger'; \
751
-	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
752
-	--log-file $$b.log --trs-file $$b.trs \
753
-	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
754
-	"$$tst" $(AM_TESTS_FD_REDIRECT)
755
-.test.log:
756
-	@p='$<'; \
757
-	$(am__set_b); \
758
-	$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
759
-	--log-file $$b.log --trs-file $$b.trs \
760
-	$(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
761
-	"$$tst" $(AM_TESTS_FD_REDIRECT)
762
-@am__EXEEXT_TRUE@.test$(EXEEXT).log:
763
-@am__EXEEXT_TRUE@	@p='$<'; \
764
-@am__EXEEXT_TRUE@	$(am__set_b); \
765
-@am__EXEEXT_TRUE@	$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
766
-@am__EXEEXT_TRUE@	--log-file $$b.log --trs-file $$b.trs \
767
-@am__EXEEXT_TRUE@	$(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
768
-@am__EXEEXT_TRUE@	"$$tst" $(AM_TESTS_FD_REDIRECT)
769
-
770
-distdir: $(BUILT_SOURCES)
771
-	$(MAKE) $(AM_MAKEFLAGS) distdir-am
772
-
773
-distdir-am: $(DISTFILES)
774
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
775
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
776
-	list='$(DISTFILES)'; \
777
-	  dist_files=`for file in $$list; do echo $$file; done | \
778
-	  sed -e "s|^$$srcdirstrip/||;t" \
779
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
780
-	case $$dist_files in \
781
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
782
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
783
-			   sort -u` ;; \
784
-	esac; \
785
-	for file in $$dist_files; do \
786
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
787
-	  if test -d $$d/$$file; then \
788
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
789
-	    if test -d "$(distdir)/$$file"; then \
790
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
791
-	    fi; \
792
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
793
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
794
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
795
-	    fi; \
796
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
797
-	  else \
798
-	    test -f "$(distdir)/$$file" \
799
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
800
-	    || exit 1; \
801
-	  fi; \
802
-	done
803
-check-am: all-am
804
-	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
805
-	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
806
-check: check-am
807
-all-am: Makefile
808
-installdirs:
809
-install: install-am
810
-install-exec: install-exec-am
811
-install-data: install-data-am
812
-uninstall: uninstall-am
813
-
814
-install-am: all-am
815
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
816
-
817
-installcheck: installcheck-am
818
-install-strip:
819
-	if test -z '$(STRIP)'; then \
820
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
821
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
822
-	      install; \
823
-	else \
824
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
825
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
826
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
827
-	fi
828
-mostlyclean-generic:
829
-	-test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
830
-	-test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
831
-	-test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
832
-
833
-clean-generic:
834
-
835
-distclean-generic:
836
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
837
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
838
-
839
-maintainer-clean-generic:
840
-	@echo "This command is intended for maintainers to use"
841
-	@echo "it deletes files that may require special tools to rebuild."
842
-clean: clean-am
843
-
844
-clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am
845
-
846
-distclean: distclean-am
847
-		-rm -f ./$(DEPDIR)/check_logger-check_logger.Po
848
-	-rm -f Makefile
849
-distclean-am: clean-am distclean-compile distclean-generic \
850
-	distclean-tags
851
-
852
-dvi: dvi-am
853
-
854
-dvi-am:
855
-
856
-html: html-am
857
-
858
-html-am:
859
-
860
-info: info-am
861
-
862
-info-am:
863
-
864
-install-data-am:
865
-
866
-install-dvi: install-dvi-am
867
-
868
-install-dvi-am:
869
-
870
-install-exec-am:
871
-
872
-install-html: install-html-am
873
-
874
-install-html-am:
875
-
876
-install-info: install-info-am
877
-
878
-install-info-am:
879
-
880
-install-man:
881
-
882
-install-pdf: install-pdf-am
883
-
884
-install-pdf-am:
885
-
886
-install-ps: install-ps-am
887
-
888
-install-ps-am:
889
-
890
-installcheck-am:
891
-
892
-maintainer-clean: maintainer-clean-am
893
-		-rm -f ./$(DEPDIR)/check_logger-check_logger.Po
894
-	-rm -f Makefile
895
-maintainer-clean-am: distclean-am maintainer-clean-generic
896
-
897
-mostlyclean: mostlyclean-am
898
-
899
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
900
-
901
-pdf: pdf-am
902
-
903
-pdf-am:
904
-
905
-ps: ps-am
906
-
907
-ps-am:
908
-
909
-uninstall-am:
910
-
911
-.MAKE: check-am install-am install-strip
912
-
913
-.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \
914
-	check-am clean clean-checkPROGRAMS clean-generic cscopelist-am \
915
-	ctags ctags-am distclean distclean-compile distclean-generic \
916
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
917
-	install install-am install-data install-data-am install-dvi \
918
-	install-dvi-am install-exec install-exec-am install-html \
919
-	install-html-am install-info install-info-am install-man \
920
-	install-pdf install-pdf-am install-ps install-ps-am \
921
-	install-strip installcheck installcheck-am installdirs \
922
-	maintainer-clean maintainer-clean-generic mostlyclean \
923
-	mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
924
-	recheck tags tags-am uninstall uninstall-am
925
-
926
-.PRECIOUS: Makefile
927
-
928
-
929
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
930
-# Otherwise a system limit (for SysV at least) may be exceeded.
931
-.NOEXPORT:

+ 27
- 3
tests/check_logger.c View File

@@ -58,8 +58,31 @@ END_TEST
58 58
 START_TEST(test_logger_add)
59 59
 {
60 60
 	char tmplog[128];
61
+	char logfmt[] = "{level} {ident} {msg}";
62
+	int ret;
63
+	pyfcgi_conf_logger_t *conf;
64
+	pyfcgi_logger_t *logger;
65
+	pyfcgi_logger_format_t *fmt;
66
+
67
+	pyfcgi_logger_init();
68
+
69
+	conf = &PyFCGI_conf.logs;
70
+	logger = &(conf->loggers[0]);
71
+
61 72
 	snprintf(tmplog, 128, "%s/%s", tmpdir, "format_add.log");
62
-	pyfcgi_logger_add(tmplog, 0xFF, 0xFF, NULL);
73
+	ret = pyfcgi_logger_add(tmplog, 0xFF, 0xFF, logfmt);
74
+	ck_assert_int_eq(ret, 0);
75
+	ck_assert_int_eq(conf->logger_sz, 1);
76
+	ck_assert_str_eq(logger->filename, tmplog);
77
+	fmt = &(conf->formats[logger->fmt_id]);
78
+	ck_assert_str_eq(fmt->fmt, logfmt);
79
+
80
+	pyfcgi_log(LOG_ALERT, "Hello world ! %s\n", tmplog);
81
+
82
+	pyfcgi_logger_stop();
83
+
84
+	//unlink(tmplog);
85
+	
63 86
 }
64 87
 END_TEST
65 88
 
@@ -149,7 +172,7 @@ START_TEST(test_logger_format_add_default)
149 172
 	ck_assert_int_eq(ret, 0);
150 173
 	ck_assert_int_eq(conf->format_sz, 1);
151 174
 	ck_assert_int_eq(s, 0);
152
-	ck_assert_str_eq(conf->formats[s].fmt, PYFCGI_LOGGER_TIME_FMT_DEFAULT);
175
+	ck_assert_str_eq(conf->formats[s].fmt, PYFCGI_LOGGER_FMT_DEFAULT);
153 176
 }
154 177
 END_TEST
155 178
 
@@ -534,6 +557,7 @@ Suite * logger_suite(void)
534 557
 	tc_init = tcase_create("Initialisation");
535 558
 	tcase_add_test(tc_init, test_logger_init);
536 559
 	tcase_add_test(tc_init, test_logger_format_add);
560
+	tcase_add_test(tc_init, test_logger_add);
537 561
 	suite_add_tcase(s, tc_init);
538 562
 
539 563
 
@@ -558,7 +582,7 @@ int main(void)
558 582
 	nfailed = srunner_ntests_failed(sr);
559 583
 	srunner_free(sr);
560 584
 
561
-	rmdir(tmpdir);
585
+	//rmdir(tmpdir);
562 586
 
563 587
 	return (!nfailed)?EXIT_SUCCESS:EXIT_FAILURE;
564 588
 }

Loading…
Cancel
Save