libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

Makefile.am (7989B)


      1 # This Makefile.am is in the public domain
      2 
      3 SUBDIRS  = .
      4 
      5 # ZZUF_SEED can be redefined to use other initial seeds
      6 # for extended testing. E.g.,
      7 #  make ZZUF_SEED=1234 check
      8 # When a test fails, the runner scripts print the seed(s) that produced
      9 # the failure so that the failure can be replayed with this variable.
     10 ZZUF_SEED = 0
     11 
     12 # ZZUF_SEED_START / ZZUF_SEED_STOP sweep a whole range of seeds instead of
     13 # using a single one; they are mapped onto zzuf's "--seed=start:stop".
     14 # Every seed in the range starts one new child, so a large range takes a
     15 # correspondingly long time. E.g.,
     16 #  make ZZUF_SEED_START=0 ZZUF_SEED_STOP=500 check
     17 # ZZUF_SEED_START takes precedence over ZZUF_SEED.
     18 ZZUF_SEED_START =
     19 ZZUF_SEED_STOP =
     20 
     21 
     22 # Additional flags for zzuf
     23 ZZUF_FLAGS =
     24 
     25 # Additional flags for socat (if socat is used)
     26 SOCAT_FLAGS =
     27 
     28 # Sanitizer options that are appended to the options set by configure.
     29 # The fuzzing tests must abort at the very first error, otherwise the
     30 # input that produced the error is lost.
     31 # Leak detection is off: under fuzzing MHD legitimately abandons
     32 # half-processed requests, and the test itself is killed by zzuf.
     33 # To run the fuzzing tests under the sanitizers, configure MHD with
     34 #  ./configure --enable-sanitizers=address,undefined
     35 # (this automatically makes the socat mode mandatory, as zzuf and the
     36 # sanitizers cannot both intercept the standard library calls).
     37 ZZUF_ASAN_OPTIONS = abort_on_error=1:detect_leaks=0
     38 ZZUF_UBSAN_OPTIONS = print_stacktrace=1:halt_on_error=1
     39 
     40 if FORCE_USE_ZZUF_SOCAT
     41 TEST_RUNNER_SCRIPT = zzuf_socat_test_runner.sh
     42 else
     43 TEST_RUNNER_SCRIPT = zzuf_test_runner.sh
     44 endif
     45 
     46 AM_CPPFLAGS = \
     47   -I$(top_srcdir)/src/include \
     48   -I$(top_srcdir)/src/microhttpd \
     49   -DMHD_CPU_COUNT=$(CPU_COUNT) \
     50   $(CPPFLAGS_ac) $(LIBCURL_CPPFLAGS)
     51 
     52 AM_CFLAGS = $(CFLAGS_ac)
     53 
     54 AM_LDFLAGS = $(LDFLAGS_ac)
     55 
     56 AM_TESTS_ENVIRONMENT = $(TESTS_ENVIRONMENT_ac) \
     57   ZZUF="$(ZZUF)" ; export ZZUF ; \
     58   ZZUF_SEED="$(ZZUF_SEED)" ; export ZZUF_SEED ; \
     59   ZZUF_SEED_START="$(ZZUF_SEED_START)" ; export ZZUF_SEED_START ; \
     60   ZZUF_SEED_STOP="$(ZZUF_SEED_STOP)" ; export ZZUF_SEED_STOP ; \
     61   ZZUF_FLAGS="$(ZZUF_FLAGS)" ; export ZZUF_FLAGS ; \
     62   SOCAT="$(SOCAT)" ; export SOCAT ; \
     63   SOCAT_FLAGS="$(SOCAT_FLAGS)" ; export SOCAT_FLAGS ; \
     64   ASAN_OPTIONS="$${ASAN_OPTIONS:+$${ASAN_OPTIONS}:}$(ZZUF_ASAN_OPTIONS)" ; \
     65   export ASAN_OPTIONS ; \
     66   UBSAN_OPTIONS="$${UBSAN_OPTIONS:+$${UBSAN_OPTIONS}:}$(ZZUF_UBSAN_OPTIONS)" ; \
     67   export UBSAN_OPTIONS ;
     68 
     69 if USE_COVERAGE
     70   AM_CFLAGS += -fprofile-arcs -ftest-coverage
     71 endif
     72 
     73 LDADD = \
     74   $(top_builddir)/src/microhttpd/libmicrohttpd.la \
     75   @LIBCURL@
     76 
     77 $(top_builddir)/src/microhttpd/libmicrohttpd.la: $(top_builddir)/src/microhttpd/Makefile
     78 	@echo ' cd $(top_builddir)/src/microhttpd && $(MAKE) $(AM_MAKEFLAGS) libmicrohttpd.la'; \
     79 	$(am__cd) $(top_builddir)/src/microhttpd && $(MAKE) $(AM_MAKEFLAGS) libmicrohttpd.la
     80 
     81 check_PROGRAMS = \
     82   test_get \
     83   test_get_chunked \
     84   test_post \
     85   test_post_form \
     86   test_put \
     87   test_put_chunked \
     88   test_put_large \
     89   test_get_long_uri \
     90   test_get_long_header \
     91   test_get_close \
     92   test_get_chunked_close \
     93   test_post_close \
     94   test_post_form_close \
     95   test_put_close \
     96   test_put_chunked_close \
     97   test_put_large_close \
     98   test_get_long_uri_close \
     99   test_get_long_header_close \
    100   test_get10 \
    101   test_get_chunked10 \
    102   test_post10 \
    103   test_post_form10 \
    104   test_put10 \
    105   test_put_large10 \
    106   test_get_long_uri10 \
    107   test_get_long_header10 \
    108   test_get_hostile \
    109   test_get_chunked_hostile \
    110   test_post_hostile \
    111   test_put_chunked_hostile \
    112   test_put_large_hostile \
    113   test_get_args \
    114   test_get_args_close \
    115   test_get_args10 \
    116   test_get_chunked_ext \
    117   test_get_chunked_ext_close \
    118   test_put_chunked_ext \
    119   test_put_chunked_ext_close \
    120   test_pipelined \
    121   test_pipelined_close
    122 
    123 if ENABLE_DAUTH
    124 check_PROGRAMS += \
    125   test_digest_auth \
    126   test_digest_auth_close
    127 endif
    128 
    129 if ENABLE_BAUTH
    130 check_PROGRAMS += \
    131   test_basic_auth \
    132   test_basic_auth_close
    133 endif
    134 
    135 .NOTPARALLEL:
    136 
    137 
    138 TESTS = $(check_PROGRAMS)
    139 
    140 dist_check_SCRIPTS = zzuf_test_runner.sh zzuf_socat_test_runner.sh
    141 
    142 LOG_COMPILER = @SHELL@ "$(srcdir)/$(TEST_RUNNER_SCRIPT)"
    143 
    144 if VHEAVY_TESTS
    145 check_SCRIPTS = warn_vheavy_use
    146 
    147 .PHONY: warn_vheavy_use
    148 endif
    149 
    150 warn_vheavy_use:
    151 	@echo "NOTICE" ; \
    152 	echo "NOTICE: Full heavy tests are enabled. Each test may take up to several minutes to complete." ; \
    153 	echo "NOTICE"
    154 
    155 
    156 tests_common_sources = \
    157   mhd_debug_funcs.h mhd_debug_funcs.c \
    158   mhd_zzuf_common.h mhd_zzuf_common.c
    159 
    160 test_get_SOURCES = \
    161   test_get.c $(tests_common_sources)
    162 
    163 test_get_chunked_SOURCES = $(test_get_SOURCES)
    164 
    165 test_post_SOURCES = $(test_get_SOURCES)
    166 
    167 test_post_form_SOURCES = $(test_get_SOURCES)
    168 
    169 test_put_SOURCES = $(test_get_SOURCES)
    170 
    171 test_put_chunked_SOURCES = $(test_get_SOURCES)
    172 
    173 test_put_large_SOURCES = $(test_get_SOURCES)
    174 
    175 test_get_long_uri_SOURCES = $(test_get_SOURCES)
    176 
    177 test_get_long_header_SOURCES = $(test_get_SOURCES)
    178 
    179 test_get_close_SOURCES = $(test_get_SOURCES)
    180 
    181 test_get_chunked_close_SOURCES = $(test_get_chunked_SOURCES)
    182 
    183 test_post_close_SOURCES = $(test_post_SOURCES)
    184 
    185 test_post_form_close_SOURCES = $(test_post_form_SOURCES)
    186 
    187 test_put_close_SOURCES = $(test_put_SOURCES)
    188 
    189 test_put_chunked_close_SOURCES = $(test_put_chunked_SOURCES)
    190 
    191 test_put_large_close_SOURCES = $(test_put_large_SOURCES)
    192 
    193 test_get_long_uri_close_SOURCES = $(test_get_long_uri_SOURCES)
    194 
    195 test_get_long_header_close_SOURCES = $(test_get_long_header_SOURCES)
    196 
    197 test_get10_SOURCES = $(test_get_SOURCES)
    198 
    199 test_get_chunked10_SOURCES = $(test_get_chunked_SOURCES)
    200 
    201 test_post10_SOURCES = $(test_post_SOURCES)
    202 
    203 test_post_form10_SOURCES = $(test_post_form_SOURCES)
    204 
    205 test_put10_SOURCES = $(test_put_SOURCES)
    206 
    207 test_put_large10_SOURCES = $(test_put_large_SOURCES)
    208 
    209 test_get_long_uri10_SOURCES = $(test_get_long_uri_SOURCES)
    210 
    211 test_get_long_header10_SOURCES = $(test_get_long_header_SOURCES)
    212 
    213 # The "_hostile" variants run exactly the same client/server exchange as
    214 # the programs above, but every started daemon uses another entry of the
    215 # "hostile" daemon option matrix (see mhd_zzuf_common.c): tiny connection
    216 # memory pools, small connection limits, short timeouts and the whole
    217 # range of MHD_OPTION_CLIENT_DISCIPLINE_LVL /
    218 # MHD_OPTION_STRICT_FOR_CLIENT values.
    219 
    220 test_get_hostile_SOURCES = $(test_get_SOURCES)
    221 
    222 test_get_chunked_hostile_SOURCES = $(test_get_chunked_SOURCES)
    223 
    224 test_post_hostile_SOURCES = $(test_post_SOURCES)
    225 
    226 test_put_chunked_hostile_SOURCES = $(test_put_chunked_SOURCES)
    227 
    228 test_put_large_hostile_SOURCES = $(test_put_large_SOURCES)
    229 
    230 # GET requests with hostile query strings (arguments without '=', empty
    231 # names and values, trailing '&', percent-encoded names, a very long tail
    232 # argument), combined with connection memory pools below MHD_BUF_INC_SIZE.
    233 
    234 test_get_args_SOURCES = \
    235   test_get_args.c $(tests_common_sources)
    236 
    237 test_get_args_close_SOURCES = $(test_get_args_SOURCES)
    238 
    239 test_get_args10_SOURCES = $(test_get_args_SOURCES)
    240 
    241 # Chunked transfers whose chunk-size lines carry chunk extensions, plus
    242 # trailers/footers. libcurl cannot produce chunk extensions, so these
    243 # tests use the raw socket client of mhd_zzuf_common.c.
    244 
    245 test_get_chunked_ext_SOURCES = \
    246   test_get_chunked_ext.c $(tests_common_sources)
    247 
    248 test_get_chunked_ext_close_SOURCES = $(test_get_chunked_ext_SOURCES)
    249 
    250 test_put_chunked_ext_SOURCES = $(test_get_chunked_ext_SOURCES)
    251 
    252 test_put_chunked_ext_close_SOURCES = $(test_get_chunked_ext_SOURCES)
    253 
    254 # Several complete requests written with a single send() call.
    255 
    256 test_pipelined_SOURCES = \
    257   test_pipelined.c $(tests_common_sources)
    258 
    259 test_pipelined_close_SOURCES = $(test_pipelined_SOURCES)
    260 
    261 # Authentication. Both are built only if the respective support has not
    262 # been disabled at configure time (--disable-dauth / --disable-bauth).
    263 
    264 test_digest_auth_SOURCES = \
    265   test_digest_auth.c $(tests_common_sources)
    266 
    267 test_digest_auth_close_SOURCES = $(test_digest_auth_SOURCES)
    268 
    269 test_basic_auth_SOURCES = \
    270   test_basic_auth.c $(tests_common_sources)
    271 
    272 test_basic_auth_close_SOURCES = $(test_basic_auth_SOURCES)