summaryrefslogtreecommitdiffstats
path: root/lib/tests/Makefile.am
blob: 596d00fd3bc2834f03bd8a758ce0a9e34f9c46b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

noinst_PROGRAMS = @EXTRA_TEST@

# These two lines support "make check", but we use "make test"
TESTS = @EXTRA_TEST@
check_PROGRAMS = @EXTRA_TEST@

INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins

EXTRA_PROGRAMS = test_utils test_disk test_tcp test_cmd test_base64 test_ini test_opts

np_test_scripts = test_base64.t test_cmd.t test_disk.t test_ini.t test_opts.t test_tcp.t test_utils.t
np_test_files = config-dos.ini config-opts.ini config-tiny.ini plugin.ini plugins.ini
EXTRA_DIST = $(np_test_scripts) $(np_test_files)

LIBS = @LIBINTL@

if USE_LIBTAP_LOCAL
tap_cflags = -I$(top_srcdir)/tap
tap_ldflags = -L$(top_srcdir)/tap
tap_ldadd = $(top_srcdir)/gl/libgnu.a
else
## Shouldn't we detect that??
tap_ldflags = -L/usr/local/lib
endif

test_utils_SOURCES = test_utils.c
test_utils_CFLAGS = -g -I.. $(tap_cflags)
test_utils_LDFLAGS = $(tap_ldflags) -ltap
test_utils_LDADD = ../utils_base.o $(tap_ldadd)

test_disk_SOURCES = test_disk.c
test_disk_CFLAGS = -g -I.. $(tap_cflags)
test_disk_LDFLAGS = $(tap_ldflags) -ltap
test_disk_LDADD = ../utils_disk.o $(top_srcdir)/gl/libgnu.a

test_tcp_SOURCES = test_tcp.c
test_tcp_CFLAGS = -g -I.. $(tap_cflags)
test_tcp_LDFLAGS = $(tap_ldflags) -ltap
test_tcp_LDADD = ../utils_tcp.o $(tap_ldadd)

test_cmd_SOURCES = test_cmd.c
test_cmd_CFLAGS = -g -I.. $(tap_cflags)
test_cmd_LDFLAGS = $(tap_ldflags) -ltap
test_cmd_LDADD = ../utils_cmd.o ../utils_base.o $(tap_ldadd)

test_base64_SOURCES = test_base64.c
test_base64_CFLAGS = -g -I.. $(tap_cflags)
test_base64_LDFLAGS = $(tap_ldflags) -ltap
test_base64_LDADD = $(top_srcdir)/gl/base64.o $(tap_ldadd)

test_ini_SOURCES = test_ini.c
test_ini_CFLAGS = -g -I.. $(tap_cflags)
test_ini_LDFLAGS = $(tap_ldflags) -ltap
test_ini_LDADD = ../utils_base.o ../parse_ini.o $(tap_ldadd)

test_opts_SOURCES = test_opts.c
test_opts_CFLAGS = -g -I.. $(tap_cflags)
test_opts_LDFLAGS = $(tap_ldflags) -ltap
test_opts_LDADD = ../utils_base.o ../parse_ini.o ../extra_opts.o $(tap_ldadd)

test: ${noinst_PROGRAMS}
	perl -MTest::Harness -e '$$Test::Harness::switches=""; runtests(map {$$_ .= ".t"} @ARGV)' $(EXTRA_PROGRAMS)

test-debug: ${noinst_PROGRAMS}
	perl -MTest::Harness -e '$$Test::Harness::verbose=1; $$Test::Harness::switches=""; runtests(map {$$_ .= ".t"} @ARGV)' $(EXTRA_PROGRAMS)