1# nghttp2 - HTTP/2 C Library 2 3# Copyright (c) 2012 Tatsuhiro Tsujikawa 4 5# Permission is hereby granted, free of charge, to any person obtaining 6# a copy of this software and associated documentation files (the 7# "Software"), to deal in the Software without restriction, including 8# without limitation the rights to use, copy, modify, merge, publish, 9# distribute, sublicense, and/or sell copies of the Software, and to 10# permit persons to whom the Software is furnished to do so, subject to 11# the following conditions: 12 13# The above copyright notice and this permission notice shall be 14# included in all copies or substantial portions of the Software. 15 16# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23SUBDIRS = testdata 24 25EXTRA_DIST = CMakeLists.txt 26 27if HAVE_CUNIT 28 29check_PROGRAMS = main 30 31if ENABLE_FAILMALLOC 32check_PROGRAMS += failmalloc 33endif # ENABLE_FAILMALLOC 34 35OBJECTS = main.c nghttp2_pq_test.c nghttp2_map_test.c nghttp2_queue_test.c \ 36 nghttp2_test_helper.c \ 37 nghttp2_frame_test.c \ 38 nghttp2_stream_test.c \ 39 nghttp2_session_test.c \ 40 nghttp2_hd_test.c \ 41 nghttp2_npn_test.c \ 42 nghttp2_helper_test.c \ 43 nghttp2_buf_test.c 44 45HFILES = nghttp2_pq_test.h nghttp2_map_test.h nghttp2_queue_test.h \ 46 nghttp2_session_test.h \ 47 nghttp2_frame_test.h nghttp2_stream_test.h nghttp2_hd_test.h \ 48 nghttp2_npn_test.h nghttp2_helper_test.h \ 49 nghttp2_test_helper.h \ 50 nghttp2_buf_test.h 51 52main_SOURCES = $(HFILES) $(OBJECTS) 53 54if ENABLE_STATIC 55main_LDADD = ${top_builddir}/lib/libnghttp2.la 56else 57# With static lib disabled and symbol hiding enabled, we have to link object 58# files directly because the tests use symbols not included in public API. 59main_LDADD = ${top_builddir}/lib/.libs/*.o 60endif 61 62main_LDADD += @CUNIT_LIBS@ @TESTLDADD@ 63main_LDFLAGS = -static 64 65if ENABLE_FAILMALLOC 66failmalloc_SOURCES = failmalloc.c failmalloc_test.c failmalloc_test.h \ 67 malloc_wrapper.c malloc_wrapper.h \ 68 nghttp2_test_helper.c nghttp2_test_helper.h 69failmalloc_LDADD = $(main_LDADD) 70failmalloc_LDFLAGS = $(main_LDFLAGS) 71endif # ENABLE_FAILMALLOC 72 73AM_CFLAGS = $(WARNCFLAGS) \ 74 -I${top_srcdir}/lib \ 75 -I${top_srcdir}/lib/includes \ 76 -I${top_builddir}/lib/includes \ 77 @CUNIT_CFLAGS@ @DEFS@ 78 79TESTS = main 80 81if ENABLE_FAILMALLOC 82TESTS += failmalloc 83endif # ENABLE_FAILMALLOC 84 85if ENABLE_APP 86 87# EXTRA_DIST = end_to_end.py 88# TESTS += end_to_end.py 89 90endif # ENABLE_APP 91 92endif # HAVE_CUNIT 93