diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/configure.ac | 5 | ||||
-rw-r--r-- | cpp/etc/Makefile.am | 3 | ||||
-rw-r--r-- | cpp/examples/Makefile (renamed from cpp/examples/examples/Makefile) | 0 | ||||
-rw-r--r-- | cpp/examples/Makefile.am | 86 | ||||
-rw-r--r-- | cpp/examples/README.verify | 26 | ||||
-rw-r--r-- | cpp/examples/direct/Makefile.am | 29 | ||||
-rw-r--r-- | cpp/examples/direct/declare_queues.cpp (renamed from cpp/examples/examples/direct/declare_queues.cpp) | 0 | ||||
-rw-r--r-- | cpp/examples/direct/direct_producer.cpp (renamed from cpp/examples/examples/direct/direct_producer.cpp) | 0 | ||||
-rw-r--r-- | cpp/examples/direct/listener.cpp (renamed from cpp/examples/examples/direct/listener.cpp) | 0 | ||||
-rw-r--r-- | cpp/examples/direct/verify (renamed from cpp/examples/examples/direct/verify) | 0 | ||||
-rw-r--r-- | cpp/examples/direct/verify.in (renamed from cpp/examples/examples/direct/verify.in) | 0 | ||||
-rw-r--r-- | cpp/examples/direct/verify_cpp_python (renamed from cpp/examples/examples/direct/verify_cpp_python) | 0 | ||||
-rw-r--r-- | cpp/examples/direct/verify_cpp_python.in (renamed from cpp/examples/examples/direct/verify_cpp_python.in) | 0 | ||||
-rw-r--r-- | cpp/examples/direct/verify_python_cpp (renamed from cpp/examples/examples/direct/verify_python_cpp) | 0 | ||||
-rw-r--r-- | cpp/examples/direct/verify_python_cpp.in (renamed from cpp/examples/examples/direct/verify_python_cpp.in) | 0 | ||||
-rw-r--r-- | cpp/examples/examples/README | 127 | ||||
-rw-r--r-- | cpp/examples/examples/direct/Makefile | 10 | ||||
-rw-r--r-- | cpp/examples/examples/fanout/Makefile | 10 | ||||
-rw-r--r-- | cpp/examples/examples/pub-sub/Makefile | 10 | ||||
-rw-r--r-- | cpp/examples/examples/request-response/Makefile | 10 | ||||
-rw-r--r-- | cpp/examples/examples/xml-exchange/Makefile | 7 | ||||
-rw-r--r-- | cpp/examples/fanout/Makefile.am | 29 | ||||
-rw-r--r-- | cpp/examples/fanout/fanout_producer.cpp (renamed from cpp/examples/examples/fanout/fanout_producer.cpp) | 0 | ||||
-rw-r--r-- | cpp/examples/fanout/listener.cpp (renamed from cpp/examples/examples/fanout/listener.cpp) | 0 | ||||
-rw-r--r-- | cpp/examples/fanout/verify (renamed from cpp/examples/examples/fanout/verify) | 0 | ||||
-rw-r--r-- | cpp/examples/fanout/verify.in (renamed from cpp/examples/examples/fanout/verify.in) | 0 | ||||
-rw-r--r-- | cpp/examples/fanout/verify_cpp_python (renamed from cpp/examples/examples/fanout/verify_cpp_python) | 0 | ||||
-rw-r--r-- | cpp/examples/fanout/verify_cpp_python.in (renamed from cpp/examples/examples/fanout/verify_cpp_python.in) | 0 | ||||
-rw-r--r-- | cpp/examples/fanout/verify_python_cpp (renamed from cpp/examples/examples/fanout/verify_python_cpp) | 0 | ||||
-rw-r--r-- | cpp/examples/fanout/verify_python_cpp.in (renamed from cpp/examples/examples/fanout/verify_python_cpp.in) | 0 | ||||
-rw-r--r-- | cpp/examples/makedist.mk | 20 | ||||
-rw-r--r-- | cpp/examples/pub-sub/Makefile.am | 30 | ||||
-rw-r--r-- | cpp/examples/pub-sub/topic_listener.cpp (renamed from cpp/examples/examples/pub-sub/topic_listener.cpp) | 0 | ||||
-rw-r--r-- | cpp/examples/pub-sub/topic_publisher.cpp (renamed from cpp/examples/examples/pub-sub/topic_publisher.cpp) | 0 | ||||
-rw-r--r-- | cpp/examples/pub-sub/verify (renamed from cpp/examples/examples/pub-sub/verify) | 0 | ||||
-rw-r--r-- | cpp/examples/pub-sub/verify.in (renamed from cpp/examples/examples/pub-sub/verify.in) | 0 | ||||
-rw-r--r-- | cpp/examples/pub-sub/verify_cpp_python (renamed from cpp/examples/examples/pub-sub/verify_cpp_python) | 0 | ||||
-rw-r--r-- | cpp/examples/pub-sub/verify_cpp_python.in (renamed from cpp/examples/examples/pub-sub/verify_cpp_python.in) | 0 | ||||
-rw-r--r-- | cpp/examples/pub-sub/verify_python_cpp (renamed from cpp/examples/examples/pub-sub/verify_python_cpp) | 0 | ||||
-rw-r--r-- | cpp/examples/pub-sub/verify_python_cpp.in (renamed from cpp/examples/examples/pub-sub/verify_python_cpp.in) | 0 | ||||
-rw-r--r-- | cpp/examples/request-response/Makefile.am | 30 | ||||
-rw-r--r-- | cpp/examples/request-response/client.cpp (renamed from cpp/examples/examples/request-response/client.cpp) | 0 | ||||
-rw-r--r-- | cpp/examples/request-response/server.cpp (renamed from cpp/examples/examples/request-response/server.cpp) | 0 | ||||
-rw-r--r-- | cpp/examples/request-response/verify (renamed from cpp/examples/examples/request-response/verify) | 0 | ||||
-rw-r--r-- | cpp/examples/request-response/verify.in (renamed from cpp/examples/examples/request-response/verify.in) | 0 | ||||
-rw-r--r-- | cpp/examples/request-response/verify_cpp_python (renamed from cpp/examples/examples/request-response/verify_cpp_python) | 0 | ||||
-rw-r--r-- | cpp/examples/request-response/verify_cpp_python.in (renamed from cpp/examples/examples/request-response/verify_cpp_python.in) | 0 | ||||
-rw-r--r-- | cpp/examples/request-response/verify_python_cpp (renamed from cpp/examples/examples/request-response/verify_python_cpp) | 0 | ||||
-rw-r--r-- | cpp/examples/request-response/verify_python_cpp.in (renamed from cpp/examples/examples/request-response/verify_python_cpp.in) | 0 | ||||
-rwxr-xr-x | cpp/examples/verify | 3 | ||||
-rwxr-xr-x | cpp/examples/verify_all | 7 | ||||
-rw-r--r-- | cpp/examples/xml-exchange/Makefile.am | 29 | ||||
-rw-r--r-- | cpp/examples/xml-exchange/README (renamed from cpp/examples/examples/xml-exchange/README) | 0 | ||||
-rw-r--r-- | cpp/examples/xml-exchange/declare_queues.cpp (renamed from cpp/examples/examples/xml-exchange/declare_queues.cpp) | 0 | ||||
-rw-r--r-- | cpp/examples/xml-exchange/listener.cpp (renamed from cpp/examples/examples/xml-exchange/listener.cpp) | 0 | ||||
-rw-r--r-- | cpp/examples/xml-exchange/xml_producer.cpp (renamed from cpp/examples/examples/xml-exchange/xml_producer.cpp) | 0 | ||||
-rw-r--r-- | cpp/src/Makefile.am | 2 | ||||
-rw-r--r-- | cpp/src/tests/.valgrindrc | 7 | ||||
-rw-r--r-- | cpp/src/tests/Makefile.am | 1 | ||||
-rw-r--r-- | cpp/src/tests/cluster.mk | 2 | ||||
-rwxr-xr-x | cpp/src/tests/run_test | 30 |
61 files changed, 246 insertions, 267 deletions
diff --git a/cpp/configure.ac b/cpp/configure.ac index b8184483ca..6cc440a00a 100644 --- a/cpp/configure.ac +++ b/cpp/configure.ac @@ -273,6 +273,11 @@ AC_CONFIG_FILES([ qpidc.spec Makefile examples/Makefile + examples/direct/Makefile + examples/fanout/Makefile + examples/pub-sub/Makefile + examples/request-response/Makefile + examples/xml-exchange/Makefile managementgen/Makefile etc/Makefile src/Makefile diff --git a/cpp/etc/Makefile.am b/cpp/etc/Makefile.am index 6c7fa13c29..f683459cd4 100644 --- a/cpp/etc/Makefile.am +++ b/cpp/etc/Makefile.am @@ -31,4 +31,7 @@ sasldb_DATA = $(SASL_DB) # users live, and we want the users to exist in that realm as well. $(SASL_DB): echo guest | /usr/sbin/saslpasswd2 -c -p -f $(SASL_DB) -u QPID guest + +CLEANFILES=$(SASL_DB) + endif diff --git a/cpp/examples/examples/Makefile b/cpp/examples/Makefile index 738675c58f..738675c58f 100644 --- a/cpp/examples/examples/Makefile +++ b/cpp/examples/Makefile diff --git a/cpp/examples/Makefile.am b/cpp/examples/Makefile.am index b046540b92..be37213d67 100644 --- a/cpp/examples/Makefile.am +++ b/cpp/examples/Makefile.am @@ -1,73 +1,23 @@ +SUBDIRS = direct fanout pub-sub request-response +if HAVE_XML + SUBDIRS += xml-exchange +endif -# List all example files here -nobase_pkgdata_DATA= \ - examples/README \ - examples/Makefile \ - examples/request-response/client.cpp \ - examples/request-response/server.cpp \ - examples/request-response/Makefile \ - examples/fanout/Makefile \ - examples/fanout/listener.cpp \ - examples/fanout/fanout_producer.cpp \ - examples/pub-sub/Makefile \ - examples/pub-sub/topic_publisher.cpp \ - examples/pub-sub/topic_listener.cpp \ - examples/direct/Makefile \ - examples/direct/direct_producer.cpp \ - examples/direct/listener.cpp \ - examples/direct/declare_queues.cpp \ - examples/xml-exchange/Makefile \ - examples/xml-exchange/declare_queues.cpp \ - examples/xml-exchange/xml_producer.cpp \ - examples/xml-exchange/listener.cpp - -VERIFY_FILES= verify verify_all \ - examples/request-response/verify \ - examples/request-response/verify.in \ - examples/request-response/verify_cpp_python \ - examples/request-response/verify_cpp_python.in \ - examples/request-response/verify_python_cpp \ - examples/request-response/verify_python_cpp.in \ - examples/fanout/verify \ - examples/fanout/verify.in \ - examples/fanout/verify_cpp_python \ - examples/fanout/verify_cpp_python.in \ - examples/fanout/verify_python_cpp \ - examples/fanout/verify_python_cpp.in \ - examples/pub-sub/verify \ - examples/pub-sub/verify.in \ - examples/pub-sub/verify_cpp_python \ - examples/pub-sub/verify_cpp_python.in \ - examples/pub-sub/verify_python_cpp \ - examples/pub-sub/verify_python_cpp.in \ - examples/direct/verify \ - examples/direct/verify.in \ - examples/direct/verify_cpp_python \ - examples/direct/verify_cpp_python.in \ - examples/direct/verify_python_cpp \ - examples/direct/verify_python_cpp.in - -EXTRA_DIST=$(nobase_pkgdata_DATA) $(VERIFY_FILES) - -# Note: we don't use normal automake SUBDIRS because the example -# makefiles don't understand all the recursive automake targets. - -clean-local: - cd examples; $(MAKE) clean - rm -f examples/*/*.out examples/*/*.wait - -abs_top_builddir=@abs_top_builddir@ -abs_top_srcdir=@abs_top_srcdir@ +MAKEDIST=.libs/Makefile +SUBMAKE=' for d in $(SUBDIRS) ; do $$(MAKE) -C $$$$d $$@ ; done' +$(MAKEDIST): Makefile + @$(MKDIR_P) .libs + @$(ECHO) all: > $(MAKEDIST) + @$(ECHO) $(SUBMAKE) >> $(MAKEDIST) + @$(ECHO) clean: >> $(MAKEDIST) + @$(ECHO) $(SUBMAKE) >> $(MAKEDIST) -# Build the examples - copy sources to the build tree in VPATH build. -all-local: - test -d examples || cp -R $(srcdir)/examples . - cd examples && $(MAKE) CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS) -I$(abs_top_srcdir)/src -I$(abs_top_srcdir)/src/gen -I$(abs_top_builddir)/src -I$(abs_top_builddir)/src/gen -L$(abs_top_builddir)/src/.libs -Wl,-rpath,$(abs_top_builddir)/src/.libs" all +examplesdir=$(pkgdatadir)/examples +examples_DATA = README $(MAKEDIST) -if !HAVE_XML -exclude_examples_regexp="xml" # Exclude XML examples. -endif +EXTRA_DIST = $(examples_DATA) README.verify verify verify_all # Verify the examples in the buid tree. -check-local: all-local verify - $(srcdir)/verify_all $(abs_top_srcdir)/.. $(top_builddir)/src/qpidd $(exclude_examples_regexp) +check-local: + $(srcdir)/verify_all $(abs_top_srcdir)/.. $(abs_top_builddir)/src/qpidd $(exclude_examples_regexp) + diff --git a/cpp/examples/README.verify b/cpp/examples/README.verify new file mode 100644 index 0000000000..d15adce58d --- /dev/null +++ b/cpp/examples/README.verify @@ -0,0 +1,26 @@ += Qpid C++ Examples = + +For more information read examples/README. + +== The Verify All Script == + +The verify_all script will run C++ examples against itself and against the +Python examples. The success of the script is determined by comparing its output +against what is expected. + +=== Arguments === + +The verify_all script expects the path to Qpid trunk as an argument, in order to +setup the environment for Python examples. + +== The Verify Script == + +The verify script is capable of running one or many scripts designed to verify +the success of Qpid examples. The verify script is utilized by the verify_all +scripts. + +=== Verifying an individual example === + +This will require you using the verify script, and providing the necessary sub +script(s) it will utilize in the process. Please note that it is your +responsibility to setup the necessary environment for the verification process diff --git a/cpp/examples/direct/Makefile.am b/cpp/examples/direct/Makefile.am new file mode 100644 index 0000000000..7a0cf65968 --- /dev/null +++ b/cpp/examples/direct/Makefile.am @@ -0,0 +1,29 @@ +examplesdir=$(pkgdatadir)/examples/direct + +include $(top_srcdir)/examples/makedist.mk + +noinst_PROGRAMS=direct_producer listener declare_queues +direct_producer_SOURCES=direct_producer.cpp +direct_producer_LDADD=$(CLIENT_LIB) + +listener_SOURCES=listener.cpp +listener_LDADD=$(CLIENT_LIB) + +declare_queues_SOURCES=declare_queues.cpp +declare_queues_LDADD=$(CLIENT_LIB) + +examples_DATA= \ + direct_producer.cpp \ + listener.cpp \ + declare_queues.cpp \ + $(MAKEDIST) + +EXTRA_DIST= \ + $(examples_DATA) \ + verify \ + verify.in \ + verify_cpp_python \ + verify_cpp_python.in \ + verify_python_cpp \ + verify_python_cpp.in + diff --git a/cpp/examples/examples/direct/declare_queues.cpp b/cpp/examples/direct/declare_queues.cpp index 0cdb472665..0cdb472665 100644 --- a/cpp/examples/examples/direct/declare_queues.cpp +++ b/cpp/examples/direct/declare_queues.cpp diff --git a/cpp/examples/examples/direct/direct_producer.cpp b/cpp/examples/direct/direct_producer.cpp index 40fc644bf3..40fc644bf3 100644 --- a/cpp/examples/examples/direct/direct_producer.cpp +++ b/cpp/examples/direct/direct_producer.cpp diff --git a/cpp/examples/examples/direct/listener.cpp b/cpp/examples/direct/listener.cpp index d199b5c0bb..d199b5c0bb 100644 --- a/cpp/examples/examples/direct/listener.cpp +++ b/cpp/examples/direct/listener.cpp diff --git a/cpp/examples/examples/direct/verify b/cpp/examples/direct/verify index ac0464ef80..ac0464ef80 100644 --- a/cpp/examples/examples/direct/verify +++ b/cpp/examples/direct/verify diff --git a/cpp/examples/examples/direct/verify.in b/cpp/examples/direct/verify.in index d1e95f1151..d1e95f1151 100644 --- a/cpp/examples/examples/direct/verify.in +++ b/cpp/examples/direct/verify.in diff --git a/cpp/examples/examples/direct/verify_cpp_python b/cpp/examples/direct/verify_cpp_python index 4dc445ba27..4dc445ba27 100644 --- a/cpp/examples/examples/direct/verify_cpp_python +++ b/cpp/examples/direct/verify_cpp_python diff --git a/cpp/examples/examples/direct/verify_cpp_python.in b/cpp/examples/direct/verify_cpp_python.in index 1a329be59a..1a329be59a 100644 --- a/cpp/examples/examples/direct/verify_cpp_python.in +++ b/cpp/examples/direct/verify_cpp_python.in diff --git a/cpp/examples/examples/direct/verify_python_cpp b/cpp/examples/direct/verify_python_cpp index fe4893e120..fe4893e120 100644 --- a/cpp/examples/examples/direct/verify_python_cpp +++ b/cpp/examples/direct/verify_python_cpp diff --git a/cpp/examples/examples/direct/verify_python_cpp.in b/cpp/examples/direct/verify_python_cpp.in index 6f35255b18..6f35255b18 100644 --- a/cpp/examples/examples/direct/verify_python_cpp.in +++ b/cpp/examples/direct/verify_python_cpp.in diff --git a/cpp/examples/examples/README b/cpp/examples/examples/README deleted file mode 100644 index 5e5ae92de3..0000000000 --- a/cpp/examples/examples/README +++ /dev/null @@ -1,127 +0,0 @@ -= Qpid C++ Examples = - -Apache Qpid Examples in C++ are found inside this directory. A short description -on each example is found below. - -Please note that you will have to start the Qpid broker on port 5672, on your -localhost (127.0.0.1) before running these examples. However, it is possible to -alternatively specify the host and port when running each example. - Ex:- ./declare_queues 127.0.0.1 5673 or declare_queues.exe 127.0.0.1 5673 - -The qpid C++ broker (known as qpidd) is found -- if installed, installed under /usr/lib/qpid/ -- in /path-to-qpid-source/cpp/src/ (and in /usr/local/sbin on a Linux system). - -== Direct == - -This is an example on how to create Point-to-Point applications using Qpid. This -example contains three main components. - - 1. declare_queues - This will bind a queue to the amq.direct exchange, so that the messages sent - to the amq.direct exchange, with a given routing key (routing_key) are - delivered to a specific queue (message_queue). - - 2. direct_producer - Publishes messages to the amq.direct exchange using the given routing key - (routing_key) discussed above. - - 3. listener - Uses a message listener to listen messages from a specific queue - (message_queue) as discussed above. - -In order to run this example, - -On Linux: - # ./declare_queues - # ./direct_producer - # ./listener - -On Windows: - $ declare_queues.exe - $ direct_producer.exe - $ listener.exe - -== Fanout == - -This is an example on how to create Fanout exchange applications using Qpid. -This example has two components unlike the previous. This is because Fanout -exchange not needing a routing key to be specified. - - 1. fanout_producer - Publishes a message to the amq.fanout exchange, without using a routing key. - - 2. listener - Uses a message listener to listen messages from the amq.fanout exchange. - -Another difference between the above example and this example is that in the -above example there is no requirement for the listener to be activated before -the messages being published. However, in this example, it is required that a -listener be active before the messages being published, if not they will be -lost. - -In order to run this example, - -On Linux: - # ./listener - # ./fanout_producer - -On Windows: - $ listener.exe - $ fanout_producer.exe - -== Publisher/Subscriber == - -Showing The ability to create topic Publishers and Subscribers using Qpid is -the main objective of this example. It is required that you subscribe first, -before publishing any message due to the construction of this example. There -are two main applications in this. - - 1. topic_publisher - This application is used to publish messages to the amq.topic exchange using - multipart routing keys, usa.weather, europe.weather, usa.news and europe.news. - - 2. topic_listener - This application is used to subscribe to several private queues, such as usa, - europe, weather and news. In here, each private queue created is bound to the - amq.topic exchange using bindings that match the corresponding parts of the - multipart routing keys. - Ex:- #.news will retrieve news irrespective of destination. - -This example also shows the use of the 'control' routing key which is used by -control messages. - -In order to run this example, - -On Linux: - # ./topic_listener - # ./topic_publisher - -On Windows: - $ topic_listener.exe - $ topic_publisher.exe - -== Request/Response == - -This example shows a simple server that will accept string from a client and -convert them to upper case and send them back to the client. This too has two -main application like the previous sample. - - 1. client - This sends lines of poetry to the server. - - 2. server - This is a simple service that will convert incoming strings to upper case and - send the result to amq.direct exchange on which the client listens. It uses the - request's reply_to property as the response's routing key. - -In order to run this example, - -On Linux: - # ./server - # ./client - -On Windows: - $ server.exe - $ client.exe - diff --git a/cpp/examples/examples/direct/Makefile b/cpp/examples/examples/direct/Makefile deleted file mode 100644 index 380b5cfcb4..0000000000 --- a/cpp/examples/examples/direct/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -CXX=g++ -CXXFLAGS= -LDFLAGS=-lqpidclient - -PROGRAMS=declare_queues direct_producer listener - -all: $(PROGRAMS) - -clean: - rm -f $(PROGRAMS) diff --git a/cpp/examples/examples/fanout/Makefile b/cpp/examples/examples/fanout/Makefile deleted file mode 100644 index 7963af7ddf..0000000000 --- a/cpp/examples/examples/fanout/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -CXX=g++ -CXXFLAGS= -LDFLAGS=-lqpidclient - -PROGRAMS=fanout_producer listener - -all: $(PROGRAMS) - -clean: - rm -f $(PROGRAMS) diff --git a/cpp/examples/examples/pub-sub/Makefile b/cpp/examples/examples/pub-sub/Makefile deleted file mode 100644 index 4b2dd52efd..0000000000 --- a/cpp/examples/examples/pub-sub/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -CXX=g++ -CXXFLAGS= -LDFLAGS=-lqpidclient - -PROGRAMS=topic_listener topic_publisher - -all: $(PROGRAMS) - -clean: - rm -f $(PROGRAMS) diff --git a/cpp/examples/examples/request-response/Makefile b/cpp/examples/examples/request-response/Makefile deleted file mode 100644 index e7ef2590d3..0000000000 --- a/cpp/examples/examples/request-response/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -CXX=g++ -CXXFLAGS= -LDFLAGS=-lqpidclient - -PROGRAMS=client server - -all: $(PROGRAMS) - -clean: - rm -f $(PROGRAMS) diff --git a/cpp/examples/examples/xml-exchange/Makefile b/cpp/examples/examples/xml-exchange/Makefile deleted file mode 100644 index e598dd3be3..0000000000 --- a/cpp/examples/examples/xml-exchange/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -CXX=g++ -CXXFLAGS= -LDFLAGS=-lqpidclient -PROGRAMS=declare_queues xml_producer listener -all: $(PROGRAMS) -clean: - rm -f $(PROGRAMS) diff --git a/cpp/examples/fanout/Makefile.am b/cpp/examples/fanout/Makefile.am new file mode 100644 index 0000000000..83cda09cf4 --- /dev/null +++ b/cpp/examples/fanout/Makefile.am @@ -0,0 +1,29 @@ +examplesdir=$(pkgdatadir)/examples/fanout + +include $(top_srcdir)/examples/makedist.mk + +noinst_PROGRAMS=fanout_producer listener +fanout_producer_SOURCES=fanout_producer.cpp +fanout_producer_LDADD=$(CLIENT_LIB) + +listener_SOURCES=listener.cpp +listener_LDADD=$(CLIENT_LIB) + +examples_DATA= \ + fanout_producer.cpp \ + listener.cpp \ + $(MAKEDIST) + +EXTRA_DIST= \ + $(examples_DATA) \ + verify \ + verify.in \ + verify_cpp_python \ + verify_cpp_python.in \ + verify_python_cpp \ + verify_python_cpp.in + + + + + diff --git a/cpp/examples/examples/fanout/fanout_producer.cpp b/cpp/examples/fanout/fanout_producer.cpp index a1ca407847..a1ca407847 100644 --- a/cpp/examples/examples/fanout/fanout_producer.cpp +++ b/cpp/examples/fanout/fanout_producer.cpp diff --git a/cpp/examples/examples/fanout/listener.cpp b/cpp/examples/fanout/listener.cpp index b29c82d3d9..b29c82d3d9 100644 --- a/cpp/examples/examples/fanout/listener.cpp +++ b/cpp/examples/fanout/listener.cpp diff --git a/cpp/examples/examples/fanout/verify b/cpp/examples/fanout/verify index ace4a6dfee..ace4a6dfee 100644 --- a/cpp/examples/examples/fanout/verify +++ b/cpp/examples/fanout/verify diff --git a/cpp/examples/examples/fanout/verify.in b/cpp/examples/fanout/verify.in index 8f8612ce67..8f8612ce67 100644 --- a/cpp/examples/examples/fanout/verify.in +++ b/cpp/examples/fanout/verify.in diff --git a/cpp/examples/examples/fanout/verify_cpp_python b/cpp/examples/fanout/verify_cpp_python index 6a1ba7ad7d..6a1ba7ad7d 100644 --- a/cpp/examples/examples/fanout/verify_cpp_python +++ b/cpp/examples/fanout/verify_cpp_python diff --git a/cpp/examples/examples/fanout/verify_cpp_python.in b/cpp/examples/fanout/verify_cpp_python.in index 21bafe06de..21bafe06de 100644 --- a/cpp/examples/examples/fanout/verify_cpp_python.in +++ b/cpp/examples/fanout/verify_cpp_python.in diff --git a/cpp/examples/examples/fanout/verify_python_cpp b/cpp/examples/fanout/verify_python_cpp index d9b3361523..d9b3361523 100644 --- a/cpp/examples/examples/fanout/verify_python_cpp +++ b/cpp/examples/fanout/verify_python_cpp diff --git a/cpp/examples/examples/fanout/verify_python_cpp.in b/cpp/examples/fanout/verify_python_cpp.in index 8f9e959053..8f9e959053 100644 --- a/cpp/examples/examples/fanout/verify_python_cpp.in +++ b/cpp/examples/fanout/verify_python_cpp.in diff --git a/cpp/examples/makedist.mk b/cpp/examples/makedist.mk new file mode 100644 index 0000000000..c6d59039df --- /dev/null +++ b/cpp/examples/makedist.mk @@ -0,0 +1,20 @@ +# Settings to build the examples in automake +AM_CXXFLAGS = $(WARNING_CFLAGS) +INCLUDES = -I$(abs_top_srcdir)/src -I$(abs_top_srcdir)/src/gen -I$(abs_top_builddir)/src -I$(abs_top_builddir)/src/gen +CLIENT_LIB=$(abs_top_builddir)/src/libqpidclient.la + +# Generate a simple non-automake Makefile for distribution. +MAKEDIST=.libs/Makefile + +$(MAKEDIST): Makefile + @$(MKDIR_P) .libs + @$(ECHO) CXX=$(CXX) > $(MAKEDIST) + @$(ECHO) CXXFLAGS=$(CXXFLAGS) >> $(MAKEDIST) + @$(ECHO) LDFLAGS=-lqpidclient >> $(MAKEDIST) + @$(ECHO) >> $(MAKEDIST) + @$(ECHO) all: $(noinst_PROGRAMS) >> $(MAKEDIST) + @$(ECHO) >> $(MAKEDIST) + @$(ECHO) clean: >> $(MAKEDIST) + @$(ECHO) " rm -f $(noinst_PROGRAMS)" >> $(MAKEDIST) + + diff --git a/cpp/examples/pub-sub/Makefile.am b/cpp/examples/pub-sub/Makefile.am new file mode 100644 index 0000000000..8446a1c40c --- /dev/null +++ b/cpp/examples/pub-sub/Makefile.am @@ -0,0 +1,30 @@ +examplesdir=$(pkgdatadir)/examples/pub-sub + +include $(top_srcdir)/examples/makedist.mk + +noinst_PROGRAMS=topic_listener topic_publisher + +topic_listener_SOURCES=topic_listener.cpp +topic_listener_LDADD=$(CLIENT_LIB) + +topic_publisher_SOURCES=topic_publisher.cpp +topic_publisher_LDADD=$(CLIENT_LIB) + +examples_DATA= \ + topic_listener.cpp \ + topic_publisher.cpp \ + $(MAKEDIST) + +EXTRA_DIST= \ + $(examples_DATA) \ + verify \ + verify.in \ + verify_cpp_python \ + verify_cpp_python.in \ + verify_python_cpp \ + verify_python_cpp.in + + + + + diff --git a/cpp/examples/examples/pub-sub/topic_listener.cpp b/cpp/examples/pub-sub/topic_listener.cpp index 9996abab19..9996abab19 100644 --- a/cpp/examples/examples/pub-sub/topic_listener.cpp +++ b/cpp/examples/pub-sub/topic_listener.cpp diff --git a/cpp/examples/examples/pub-sub/topic_publisher.cpp b/cpp/examples/pub-sub/topic_publisher.cpp index ab485fec8f..ab485fec8f 100644 --- a/cpp/examples/examples/pub-sub/topic_publisher.cpp +++ b/cpp/examples/pub-sub/topic_publisher.cpp diff --git a/cpp/examples/examples/pub-sub/verify b/cpp/examples/pub-sub/verify index 3589a4c9da..3589a4c9da 100644 --- a/cpp/examples/examples/pub-sub/verify +++ b/cpp/examples/pub-sub/verify diff --git a/cpp/examples/examples/pub-sub/verify.in b/cpp/examples/pub-sub/verify.in index 6413c5c788..6413c5c788 100644 --- a/cpp/examples/examples/pub-sub/verify.in +++ b/cpp/examples/pub-sub/verify.in diff --git a/cpp/examples/examples/pub-sub/verify_cpp_python b/cpp/examples/pub-sub/verify_cpp_python index f6c6850981..f6c6850981 100644 --- a/cpp/examples/examples/pub-sub/verify_cpp_python +++ b/cpp/examples/pub-sub/verify_cpp_python diff --git a/cpp/examples/examples/pub-sub/verify_cpp_python.in b/cpp/examples/pub-sub/verify_cpp_python.in index 951d9ad9dd..951d9ad9dd 100644 --- a/cpp/examples/examples/pub-sub/verify_cpp_python.in +++ b/cpp/examples/pub-sub/verify_cpp_python.in diff --git a/cpp/examples/examples/pub-sub/verify_python_cpp b/cpp/examples/pub-sub/verify_python_cpp index 2ddaad58c2..2ddaad58c2 100644 --- a/cpp/examples/examples/pub-sub/verify_python_cpp +++ b/cpp/examples/pub-sub/verify_python_cpp diff --git a/cpp/examples/examples/pub-sub/verify_python_cpp.in b/cpp/examples/pub-sub/verify_python_cpp.in index 52e8db9d72..52e8db9d72 100644 --- a/cpp/examples/examples/pub-sub/verify_python_cpp.in +++ b/cpp/examples/pub-sub/verify_python_cpp.in diff --git a/cpp/examples/request-response/Makefile.am b/cpp/examples/request-response/Makefile.am new file mode 100644 index 0000000000..d2cddf3cfb --- /dev/null +++ b/cpp/examples/request-response/Makefile.am @@ -0,0 +1,30 @@ +examplesdir=$(pkgdatadir)/examples/request-response + +include $(top_srcdir)/examples/makedist.mk + +noinst_PROGRAMS=client server + +client_SOURCES=client.cpp +client_LDADD=$(CLIENT_LIB) + +server_SOURCES=server.cpp +server_LDADD=$(CLIENT_LIB) + +examples_DATA= \ + server.cpp \ + client.cpp \ + $(MAKEDIST) + +EXTRA_DIST= \ + $(examples_DATA) \ + verify \ + verify.in \ + verify_cpp_python \ + verify_cpp_python.in \ + verify_python_cpp \ + verify_python_cpp.in + + + + + diff --git a/cpp/examples/examples/request-response/client.cpp b/cpp/examples/request-response/client.cpp index 0ee0e78c92..0ee0e78c92 100644 --- a/cpp/examples/examples/request-response/client.cpp +++ b/cpp/examples/request-response/client.cpp diff --git a/cpp/examples/examples/request-response/server.cpp b/cpp/examples/request-response/server.cpp index df189cfdd8..df189cfdd8 100644 --- a/cpp/examples/examples/request-response/server.cpp +++ b/cpp/examples/request-response/server.cpp diff --git a/cpp/examples/examples/request-response/verify b/cpp/examples/request-response/verify index 76007ff8d2..76007ff8d2 100644 --- a/cpp/examples/examples/request-response/verify +++ b/cpp/examples/request-response/verify diff --git a/cpp/examples/examples/request-response/verify.in b/cpp/examples/request-response/verify.in index 7925dc5671..7925dc5671 100644 --- a/cpp/examples/examples/request-response/verify.in +++ b/cpp/examples/request-response/verify.in diff --git a/cpp/examples/examples/request-response/verify_cpp_python b/cpp/examples/request-response/verify_cpp_python index 867af3a92b..867af3a92b 100644 --- a/cpp/examples/examples/request-response/verify_cpp_python +++ b/cpp/examples/request-response/verify_cpp_python diff --git a/cpp/examples/examples/request-response/verify_cpp_python.in b/cpp/examples/request-response/verify_cpp_python.in index a032293d9b..a032293d9b 100644 --- a/cpp/examples/examples/request-response/verify_cpp_python.in +++ b/cpp/examples/request-response/verify_cpp_python.in diff --git a/cpp/examples/examples/request-response/verify_python_cpp b/cpp/examples/request-response/verify_python_cpp index d6f0fa7152..d6f0fa7152 100644 --- a/cpp/examples/examples/request-response/verify_python_cpp +++ b/cpp/examples/request-response/verify_python_cpp diff --git a/cpp/examples/examples/request-response/verify_python_cpp.in b/cpp/examples/request-response/verify_python_cpp.in index 1500134619..1500134619 100644 --- a/cpp/examples/examples/request-response/verify_python_cpp.in +++ b/cpp/examples/request-response/verify_python_cpp.in diff --git a/cpp/examples/verify b/cpp/examples/verify index 251097930e..247e75d4a9 100755 --- a/cpp/examples/verify +++ b/cpp/examples/verify @@ -8,7 +8,8 @@ # If $QPID_HOST or $QPID_PORT are set, use them to connect. # -export QPID_DATA_DIR= +QPID_DATA_DIR= +export QPID_DATA_DIR cleanup() { test -n "$QPIDD" && $QPIDD -q # Private broker diff --git a/cpp/examples/verify_all b/cpp/examples/verify_all index 0e797202ff..9fbaa4a8df 100755 --- a/cpp/examples/verify_all +++ b/cpp/examples/verify_all @@ -9,9 +9,10 @@ exclude_regexp=$3 python=${QPID_PYTHON_DIR:-$topsrcdir/python} trap "$qpidd -q" exit -export QPID_PORT=`$qpidd -dp0 --no-module-dir --data-dir "" --auth no` || { echo "Can't run qpidd" ; exit 1; } -export PYTHON_EXAMPLES=$python/examples -export PYTHONPATH=$python:$PYTHONPATH +QPID_PORT=`$qpidd -dp0 --no-module-dir --data-dir "" --auth no` || { echo "Can't run qpidd" ; exit 1; } +PYTHON_EXAMPLES=$python/examples +PYTHONPATH=$python:$PYTHONPATH +export QPID_PORT PYTHON_EXAMPLES PYTHONPATH test -d $PYTHON_EXAMPLES || echo "WARNING: No python examples. $PYTHON_EXAMPLES not found." find="find examples" diff --git a/cpp/examples/xml-exchange/Makefile.am b/cpp/examples/xml-exchange/Makefile.am new file mode 100644 index 0000000000..1b25a8750d --- /dev/null +++ b/cpp/examples/xml-exchange/Makefile.am @@ -0,0 +1,29 @@ +examplesdir=$(pkgdatadir)/examples/xml-exchange + +include $(top_srcdir)/examples/makedist.mk + +noinst_PROGRAMS=declare_queues xml_producer listener + +declare_queues_SOURCES=declare_queues.cpp +declare_queues_LDADD=$(CLIENT_LIB) + +xml_producer_SOURCES=xml_producer.cpp +xml_producer_LDADD=$(CLIENT_LIB) + +listener_SOURCES=listener.cpp +listener_LDADD=$(CLIENT_LIB) + +EXTRA_DIST= \ + README + +examples_DATA= \ + $(EXTRA_DIST) \ + declare_queues.cpp \ + listener.cpp \ + xml_producer.cpp \ + $(MAKEDIST) + + + + + diff --git a/cpp/examples/examples/xml-exchange/README b/cpp/examples/xml-exchange/README index 26b9fac97a..26b9fac97a 100644 --- a/cpp/examples/examples/xml-exchange/README +++ b/cpp/examples/xml-exchange/README diff --git a/cpp/examples/examples/xml-exchange/declare_queues.cpp b/cpp/examples/xml-exchange/declare_queues.cpp index 1307c473c5..1307c473c5 100644 --- a/cpp/examples/examples/xml-exchange/declare_queues.cpp +++ b/cpp/examples/xml-exchange/declare_queues.cpp diff --git a/cpp/examples/examples/xml-exchange/listener.cpp b/cpp/examples/xml-exchange/listener.cpp index 98646bea95..98646bea95 100644 --- a/cpp/examples/examples/xml-exchange/listener.cpp +++ b/cpp/examples/xml-exchange/listener.cpp diff --git a/cpp/examples/examples/xml-exchange/xml_producer.cpp b/cpp/examples/xml-exchange/xml_producer.cpp index 19889e4891..19889e4891 100644 --- a/cpp/examples/examples/xml-exchange/xml_producer.cpp +++ b/cpp/examples/xml-exchange/xml_producer.cpp diff --git a/cpp/src/Makefile.am b/cpp/src/Makefile.am index 626e948667..26f6dc7964 100644 --- a/cpp/src/Makefile.am +++ b/cpp/src/Makefile.am @@ -318,7 +318,6 @@ libqpidclient_la_SOURCES = \ qpid/client/Connector.cpp \ qpid/client/Connection.cpp \ qpid/client/ConnectionHandler.cpp \ - qpid/client/ChainableFrameHandler.h \ qpid/client/ConnectionSettings.cpp \ qpid/client/Demux.cpp \ qpid/client/Dispatcher.cpp \ @@ -434,6 +433,7 @@ nobase_include_HEADERS = \ qpid/client/AckMode.h \ qpid/client/AckPolicy.h \ qpid/client/Bounds.h \ + qpid/client/ChainableFrameHandler.h \ qpid/client/Completion.h \ qpid/client/Connection.h \ qpid/client/ConnectionHandler.h \ diff --git a/cpp/src/tests/.valgrindrc b/cpp/src/tests/.valgrindrc deleted file mode 100644 index 4aba7661de..0000000000 --- a/cpp/src/tests/.valgrindrc +++ /dev/null @@ -1,7 +0,0 @@ ---gen-suppressions=all ---leak-check=full ---demangle=yes ---suppressions=.valgrind.supp ---num-callers=25 ---trace-children=yes - diff --git a/cpp/src/tests/Makefile.am b/cpp/src/tests/Makefile.am index 57d1c04b72..c8d94c18e9 100644 --- a/cpp/src/tests/Makefile.am +++ b/cpp/src/tests/Makefile.am @@ -131,7 +131,6 @@ EXTRA_DIST += \ topictest \ run_federation_tests \ .valgrind.supp \ - .valgrindrc \ MessageUtils.h \ TestMessageStore.h \ MockConnectionInputHandler.h \ diff --git a/cpp/src/tests/cluster.mk b/cpp/src/tests/cluster.mk index ba8d99935f..d373a7d6ab 100644 --- a/cpp/src/tests/cluster.mk +++ b/cpp/src/tests/cluster.mk @@ -11,7 +11,7 @@ lib_cluster = $(abs_builddir)/../libqpidcluster.la # ais_check checks conditions for AIS tests and runs if ok. TESTS+=ais_check -EXTRA_DIST+=ais_check ais_run +EXTRA_DIST+=ais_check ais_run start_cluster stop_cluster check_PROGRAMS+=ais_test ais_test_SOURCES=ais_test.cpp Cpg.cpp diff --git a/cpp/src/tests/run_test b/cpp/src/tests/run_test index 08bf845ba1..c535c8caaa 100755 --- a/cpp/src/tests/run_test +++ b/cpp/src/tests/run_test @@ -14,34 +14,42 @@ srcdir=`dirname $0` source $srcdir/vg_check -test -f .valgrindrc || cp $srcdir/.valgrindrc . -test -f .valgrind.supp || cp $srcdir/.valgrind.supp . - # Export variables from makefile. export VALGRIND srcdir -# Export QPID_PORT if qpidd.port exists. -test -f qpidd.port && export QPID_PORT=`cat qpidd.port` +# Set QPID_PORT if qpidd.port exists. +test -f qpidd.port && QPID_PORT=`cat qpidd.port` +export QPID_PORT # Avoid silly libtool error messages if these are not defined -test -z "$LC_ALL" && export LC_ALL= -test -z "$LC_CTYPE" && export LC_CTYPE= -test -z "$LC_COLLATE" && export LC_COLLATE= -test -z "$LC_MESSAGES" && export LC_MESSAGES= +test -z "$LC_ALL" && LC_ALL= +test -z "$LC_CTYPE" && LC_CTYPE= +test -z "$LC_COLLATE" && LC_COLLATE= +test -z "$LC_MESSAGES" && LC_MESSAGES= +export LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES VG_LOG="$1.vglog" rm -f $VG_LOG* +VALGRIND_OPTS=" +--gen-suppressions=all +--leak-check=full +--demangle=yes +--suppressions=$srcdir/.valgrind.supp +--num-callers=25 +--trace-children=yes +--log-file=$VG_LOG -- +" + if grep -l "^# Generated by .*libtool" "$1" >/dev/null 2>&1; then # This is a libtool "executable". Valgrind it if VALGRIND specified. - test -n "$VALGRIND" && VALGRIND="$VALGRIND --log-file=$VG_LOG --" + test -n "$VALGRIND" && VALGRIND="$VALGRIND $VALGRIND_OPTS" # Hide output unless there's an error. libtool --mode=execute $VALGRIND "$@" 2>&1 || ERROR=$? test -n "$VALGRIND" && vg_check $VG_LOG* else # This is a non-libtool shell script, just execute it. - export VALGRIND srcdir exec "$@" fi |