summaryrefslogtreecommitdiff
path: root/cpp/tests/Makefile.am
blob: 256e68058dc1bb825e093b981b6cb038fe5a7a77 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
# 
#   http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#
AM_CXXFLAGS = $(WARNING_CFLAGS) $(CPPUNIT_CXXFLAGS)
INCLUDES =				\
  -I$(top_srcdir)/gen			\
  -I$(top_srcdir)/lib			\
  -I$(top_srcdir)/lib/client		\
  -I$(top_srcdir)/lib/broker		\
  -I$(top_srcdir)/lib/common		\
  -I$(top_srcdir)/lib/common/sys	\
  -I$(top_srcdir)/lib/common/framing	\
  $(APR_CXXFLAGS)

# FIXME: have e.g., topicall, run as part of "make check"?
EXTRA_DIST =		\
  .vg-supp		\
  setup			\
  env			\
  topicall		\
  topictest		\
  qpid_test_plugin.h	\
  APRBaseTest.cpp

client_tests =		\
  client_test		\
  echo_service		\
  topic_listener	\
  topic_publisher	

broker_tests =		\
  AccumulatedAckTest	\
  ChannelTest		\
  ExchangeTest		\
  HeadersExchangeTest	\
  InMemoryContentTest	\
  LazyLoadedContentTest	\
  MessageBuilderTest	\
  MessageTest		\
  QueueRegistryTest	\
  QueueTest		\
  QueuePolicyTest	\
  TopicExchangeTest	\
  TxAckTest		\
  TxBufferTest		\
  TxPublishTest		\
  ValueTest

framing_tests =		\
  BodyHandlerTest	\
  FieldTableTest	\
  FramingTest		\
  HeaderTest

misc_tests =		\
  ExceptionTest

posix_tests =		\
  EventChannelTest	\
  EventChannelThreadsTest

unit_tests =		\
  $(broker_tests)	\
  $(framing_tests)	\
  $(misc_tests)


noinst_PROGRAMS = $(client_tests)

abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@

TESTS_ENVIRONMENT =			\
  VALGRIND=$(VALGRIND)			\
  abs_builddir='$(abs_builddir)'	\
  PATH="$(abs_srcdir)$(PATH_SEPARATOR)$(abs_builddir)/../src$(PATH_SEPARATOR)$$PATH" \
  abs_srcdir='$(abs_srcdir)'

TESTS = run-unit-tests run-python-tests daemon_test
EXTRA_DIST += $(TESTS)

CLEANFILES=qpidd.log
DISTCLEANFILES=gen.mk

include gen.mk

extra_libs = $(CPPUNIT_LIBS)
lib_client = $(abs_builddir)/../lib/client/libqpidclient.la
lib_common = $(abs_builddir)/../lib/common/libqpidcommon.la
lib_broker = $(abs_builddir)/../lib/broker/libqpidbroker.la

gen.mk: Makefile.am
	(					\
	  for i in $(client_tests); do		\
	    echo $${i}_SOURCES = $$i.cpp;	\
	    echo $${i}_LDADD = '$$(lib_client) $$(lib_common) $$(extra_libs)'; \
	  done;					\
	  libs=;				\
	  for i in $(unit_tests); do		\
	    libs="$$libs $${i}.la";		\
	    echo $${i}_la_SOURCES = $$i.cpp;	\
	    echo $${i}_la_LIBADD = '$$(lib_common)';			\
	    echo $${i}_la_LIBADD += '$$(lib_broker) $$(extra_libs)';	\
	    echo $${i}_la_LDFLAGS = "-module -rpath `pwd`";	\
	  done;					\
	  echo "check_LTLIBRARIES =$$libs";	\
	)					\
	> $@-t
	mv $@-t $@

check_PROGRAMS = interop_runner
interop_runner_SOURCES = 	\
  interop_runner.cpp	 	\
  TestUtils.cpp                 \
  SimpleTestCaseBase.cpp	\
  BasicP2PTest.cpp		\
  BasicPubSubTest.cpp		\
  P2PMessageSizeTest.cpp        \
  PubSubMessageSizeTest.cpp     \
  TestUtils.h                   \
  SimpleTestCaseBase.h		\
  BasicP2PTest.h		\
  BasicPubSubTest.h		\
  P2PMessageSizeTest.h          \
  PubSubMessageSizeTest.h       \
  TestCase.h			\
  TestOptions.h                 
interop_runner_LDADD = $(lib_client) $(lib_common) $(extra_libs)