# vim:ft=automake
# libhostile
# Copyright (C) 2012 Data Differential
# All rights reserved.
#
# Use and distribution licensed under the BSD license.  See
# the COPYING file in the parent directory for full text.
#
# Included from Top Level Makefile.am
# All paths should be given relative to the root

# Test accept()
libhostile_t_accept_SOURCES=
libhostile_t_accept_LDADD=

libhostile_t_accept_SOURCES+= libhostile/t/accept.c
check_PROGRAMS+= libhostile/t/accept
noinst_PROGRAMS+= libhostile/t/accept

libhostile_t_hostile_accept_SOURCES=
libhostile_t_hostile_accept_LDADD=
libhostile_t_hostile_accept_CFLAGS= -DHOSTILE
libhostile_t_hostile_accept_CXXFLAGS= -DHOSTILE

libhostile_t_hostile_accept_SOURCES+= libhostile/t/accept.c
libhostile_t_hostile_accept_LDADD+= libhostile/libhostile.la
check_PROGRAMS+= libhostile/t/hostile_accept
noinst_PROGRAMS+= libhostile/t/hostile_accept

# Test pipe() 
libhostile_t_pipe_SOURCES=
libhostile_t_pipe_LDADD=

libhostile_t_pipe_SOURCES+= libhostile/t/pipe.c
check_PROGRAMS+= libhostile/t/pipe
noinst_PROGRAMS+= libhostile/t/pipe

libhostile_t_hostile_pipe_SOURCES=
libhostile_t_hostile_pipe_LDADD=
libhostile_t_hostile_pipe_CFLAGS=
libhostile_t_hostile_pipe_CXXFLAGS=

libhostile_t_hostile_pipe_SOURCES+= libhostile/t/pipe.c
libhostile_t_hostile_pipe_CFLAGS+= -DHOSTILE
libhostile_t_hostile_pipe_CXXFLAGS+= -DHOSTILE
libhostile_t_hostile_pipe_LDADD+= libhostile/libhostile.la
check_PROGRAMS+= libhostile/t/hostile_pipe
noinst_PROGRAMS+= libhostile/t/hostile_pipe

gdb-pipe: libhostile/t/hostile_pipe
	@$(GDB_COMMAND) libhostile/t/hostile_pipe

# Test pipe2() 
libhostile_t_pipe2_SOURCES=
libhostile_t_pipe2_LDADD=

libhostile_t_pipe2_SOURCES+= libhostile/t/pipe2.c
check_PROGRAMS+= libhostile/t/pipe2
noinst_PROGRAMS+= libhostile/t/pipe2

libhostile_t_hostile_pipe2_SOURCES=
libhostile_t_hostile_pipe2_LDADD=
libhostile_t_hostile_pipe2_CFLAGS=
libhostile_t_hostile_pipe2_CXXFLAGS=

libhostile_t_hostile_pipe2_SOURCES+= libhostile/t/pipe2.c
libhostile_t_hostile_pipe2_CFLAGS+= -DHOSTILE
libhostile_t_hostile_pipe2_CXXFLAGS+= -DHOSTILE
libhostile_t_hostile_pipe2_LDADD+= libhostile/libhostile.la
check_PROGRAMS+= libhostile/t/hostile_pipe2
noinst_PROGRAMS+= libhostile/t/hostile_pipe2

# Test close() 
libhostile_t_close_SOURCES=
libhostile_t_close_LDADD=

libhostile_t_close_SOURCES+= libhostile/t/close.c
check_PROGRAMS+= libhostile/t/close
noinst_PROGRAMS+= libhostile/t/close

libhostile_t_hostile_close_SOURCES=
libhostile_t_hostile_close_LDADD=
libhostile_t_hostile_close_CFLAGS=
libhostile_t_hostile_close_CXXFLAGS=

libhostile_t_hostile_close_SOURCES+= libhostile/t/close.c
libhostile_t_hostile_close_CFLAGS+= -DHOSTILE
libhostile_t_hostile_close_CXXFLAGS+= -DHOSTILE
libhostile_t_hostile_close_LDADD+= libhostile/libhostile.la
check_PROGRAMS+= libhostile/t/hostile_close
noinst_PROGRAMS+= libhostile/t/hostile_close

# Test just the hostile unit tests
unit_hostile: libhostile/t/hostile_accept libhostile/t/accept libhostile/t/pipe libhostile/t/hostile_pipe libhostile/t/pipe2 libhostile/t/hostile_pipe2 libhostile/t/close libhostile/t/hostile_close
	@libhostile/t/accept
	@libhostile/t/pipe
	@libhostile/t/pipe2
	@libhostile/t/hostile_accept
	@libhostile/t/hostile_pipe
	@libhostile/t/hostile_pipe2
