qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r602140 - in /incubator/qpid/trunk/qpid/cpp/examples: Makefile.am examples/direct/verify.in examples/fanout/verify.in examples/pub-sub/verify.in examples/request-response/verify.in verify verify_functions
Date Fri, 07 Dec 2007 16:30:18 GMT
Author: aconway
Date: Fri Dec  7 08:29:59 2007
New Revision: 602140

URL: http://svn.apache.org/viewvc?rev=602140&view=rev
Log:


examples/verify
 - run installed examples and verify their output.

examples/examples/*/verify.in
 - expected output of example, may be filtered/sorted for some examples.
   
examples/Makefile.am
 - add verify to installcheck target.

Added:
    incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify.in
    incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify.in
    incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify.in
    incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify.in
    incubator/qpid/trunk/qpid/cpp/examples/verify   (with props)
Removed:
    incubator/qpid/trunk/qpid/cpp/examples/verify_functions
Modified:
    incubator/qpid/trunk/qpid/cpp/examples/Makefile.am

Modified: incubator/qpid/trunk/qpid/cpp/examples/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/Makefile.am?rev=602140&r1=602139&r2=602140&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/Makefile.am (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/Makefile.am Fri Dec  7 08:29:59 2007
@@ -31,4 +31,5 @@
 EXAMPLE_DIR=$(DESTDIR)$(pkgdatadir)/examples 
 installcheck-local:
 	cd $(EXAMPLE_DIR) && $(MAKE) CXX="$(CXX)" CXXFLAGS="$(EXAMPLE_FLAGS)" all
+	cd ${EXAMPLE_DIR) && $(abs_srcdir)/verify
 	cd $(EXAMPLE_DIR) && $(MAKE) clean

Added: incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify.in?rev=602140&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify.in (added)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify.in Fri Dec  7 08:29:59 2007
@@ -0,0 +1,38 @@
+==== ./direct_config_queues
+====
+==== ./direct_publisher
+====
+==== ./listener
+Activating listener for: listener_destination
+Message: Message 0
+Message: Message 1
+Message: Message 2
+Message: Message 3
+Message: Message 4
+Message: Message 5
+Message: Message 6
+Message: Message 7
+Message: Message 8
+Message: Message 9
+Message: That's all, folks!
+Shutting down listener for listener_destination
+====
+==== ./direct_persistent_config_queues
+====
+==== ./direct_persistent_publisher
+====
+==== ./listener
+Activating listener for: listener_destination
+Message: Message 0
+Message: Message 1
+Message: Message 2
+Message: Message 3
+Message: Message 4
+Message: Message 5
+Message: Message 6
+Message: Message 7
+Message: Message 8
+Message: Message 9
+Message: That's all, folks!
+Shutting down listener for listener_destination
+====

Added: incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify.in?rev=602140&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify.in (added)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify.in Fri Dec  7 08:29:59 2007
@@ -0,0 +1,19 @@
+==== ./fanout_config_queues
+====
+==== ./fanout_publisher
+====
+==== ./listener
+Activating listener for: listener_destination
+Message: Message 0
+Message: Message 1
+Message: Message 2
+Message: Message 3
+Message: Message 4
+Message: Message 5
+Message: Message 6
+Message: Message 7
+Message: Message 8
+Message: Message 9
+Message: That's all, folks!
+Shutting down listener for listener_destination
+====

Added: incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify.in?rev=602140&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify.in (added)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify.in Fri Dec  7 08:29:59
2007
@@ -0,0 +1,61 @@
+==== ./topic_publisher
+====
+==== remove_uuid topic_listener.out | sort
+Declaring queue: europe
+Declaring queue: news
+Declaring queue: usa
+Declaring queue: weather
+Listening for messages ...
+Message: Message 0 from europe
+Message: Message 0 from europe
+Message: Message 0 from news
+Message: Message 0 from news
+Message: Message 0 from usa
+Message: Message 0 from usa
+Message: Message 0 from weather
+Message: Message 0 from weather
+Message: Message 1 from europe
+Message: Message 1 from europe
+Message: Message 1 from news
+Message: Message 1 from news
+Message: Message 1 from usa
+Message: Message 1 from usa
+Message: Message 1 from weather
+Message: Message 1 from weather
+Message: Message 2 from europe
+Message: Message 2 from europe
+Message: Message 2 from news
+Message: Message 2 from news
+Message: Message 2 from usa
+Message: Message 2 from usa
+Message: Message 2 from weather
+Message: Message 2 from weather
+Message: Message 3 from europe
+Message: Message 3 from europe
+Message: Message 3 from news
+Message: Message 3 from news
+Message: Message 3 from usa
+Message: Message 3 from usa
+Message: Message 3 from weather
+Message: Message 3 from weather
+Message: Message 4 from europe
+Message: Message 4 from europe
+Message: Message 4 from news
+Message: Message 4 from news
+Message: Message 4 from usa
+Message: Message 4 from usa
+Message: Message 4 from weather
+Message: Message 4 from weather
+Message: That's all, folks! from europe
+Message: That's all, folks! from news
+Message: That's all, folks! from usa
+Message: That's all, folks! from weather
+Shutting down listener for europe
+Shutting down listener for news
+Shutting down listener for usa
+Shutting down listener for weather
+Subscribing to queue europe
+Subscribing to queue news
+Subscribing to queue usa
+Subscribing to queue weather
+====

Added: incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify.in?rev=602140&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify.in (added)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify.in Fri Dec  7
08:29:59 2007
@@ -0,0 +1,21 @@
+==== ./client
+Activating response queue listener for: client 
+Request: Twas brillig, and the slithy toves
+Request: Did gire and gymble in the wabe.
+Request: All mimsy were the borogroves,
+Request: And the mome raths outgrabe.
+Waiting for all responses to arrive ...
+Response: TWAS BRILLIG, AND THE SLITHY TOVES
+Response: DID GIRE AND GYMBLE IN THE WABE.
+Response: ALL MIMSY WERE THE BOROGROVES,
+Response: AND THE MOME RATHS OUTGRABE.
+Shutting down listener for client 
+====
+==== remove_uuid server.out
+Activating request queue listener for: request_queue
+Waiting for requests
+Request:: Twas brillig, and the slithy toves  (client )
+Request:: Did gire and gymble in the wabe.  (client )
+Request:: All mimsy were the borogroves,  (client )
+Request:: And the mome raths outgrabe.  (client )
+====

Added: incubator/qpid/trunk/qpid/cpp/examples/verify
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/verify?rev=602140&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/verify (added)
+++ incubator/qpid/trunk/qpid/cpp/examples/verify Fri Dec  7 08:29:59 2007
@@ -0,0 +1,68 @@
+#!/bin/sh
+# Run from the installed examples/ dir with a full path to this script.
+#
+
+DIR=$PWD
+SRC=`dirname $0`/examples
+
+# Utility functions
+
+run() {
+    echo ==== $*; eval "$*"; echo ====;
+}
+
+waitfor() { until grep -a -l "$2" $1 >/dev/null ; do sleep 1 ; done ; }
+
+verify() {
+    ex=`basename $PWD`
+    diff -ac verify.out verify.in || { echo "FAIL: $ex  " ; RET=1 ; return 1; } 
+}
+
+HEX="[a-fA-F0-9]"
+remove_uuid() {
+    sed "s/$HEX\{8\}-$HEX\{4\}-$HEX\{4\}-$HEX\{4\}-$HEX\{12\}//g" $*
+}
+
+# Scripts for each example
+
+direct() {
+    run ./direct_config_queues  > verify.out
+    run ./direct_publisher >> verify.out
+    run ./listener >> verify.out
+    run ./direct_persistent_config_queues >> verify.out
+    run ./direct_persistent_publisher >> verify.out
+    run ./listener >> verify.out
+}
+
+fanout() {
+    run ./fanout_config_queues > verify.out
+    run ./fanout_publisher >>verify.out
+    run ./listener >>verify.out
+}
+
+pub_sub() {
+    ./topic_listener | tee topic_listener.out > topic_listener.wait &
+    waitfor topic_listener.wait  "Listening"
+    run ./topic_publisher > verify.out
+    wait 
+    run remove_uuid "topic_listener.out | sort" >> verify.out
+}
+    
+request_response() {
+    ./server | tee server.out > server.wait &
+    waitfor server.wait "Waiting"
+    run ./client | remove_uuid > verify.out
+    kill %%
+    wait 2> /dev/null
+    run remove_uuid server.out >> verify.out
+}
+
+# Main
+for ex in direct fanout pub-sub request-response; do
+    func=`echo $ex | tr - _`
+    cp $SRC/$ex/verify.in $ex
+    echo "Verifing $ex"
+    ( cd $ex && $func && verify && rm -f verify.in *.out *.wait)

+done
+
+exit $RET

Propchange: incubator/qpid/trunk/qpid/cpp/examples/verify
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message