summaryrefslogtreecommitdiff
path: root/cpp/examples
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-02-12 21:39:55 +0000
committerAlan Conway <aconway@apache.org>2008-02-12 21:39:55 +0000
commit3e01d2866338273d28d26dd6caf2cf94aa0f9e3c (patch)
tree53d57b3d8bb9faf2fe8211f5dc6e7be92543962b /cpp/examples
parent6e835338bdd2411ff31fb90a6d6675ae23b15dc5 (diff)
downloadqpid-python-3e01d2866338273d28d26dd6caf2cf94aa0f9e3c.tar.gz
Create a tar file of verify scripts suitable for untarring into and installed examples directory.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@627128 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/examples')
-rw-r--r--cpp/examples/Makefile.am5
-rwxr-xr-xcpp/examples/verify81
-rwxr-xr-xcpp/examples/verify_all14
3 files changed, 12 insertions, 88 deletions
diff --git a/cpp/examples/Makefile.am b/cpp/examples/Makefile.am
index 3c896e2f68..6e696c1ab2 100644
--- a/cpp/examples/Makefile.am
+++ b/cpp/examples/Makefile.am
@@ -61,9 +61,8 @@ all-local:
cd examples && $(MAKE) CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS) -I../../$(top_srcdir)/src -I../../$(top_srcdir)/src/gen -I../../$(top_builddir)/src/gen -L../../$(top_builddir)/src/.libs -Wl,-rpath,$(abs_top_builddir)/src/.libs" all
# Verify the examples in the buid tree.
-VERIFY=QPID_DATA_DIR= QPIDD=$(abs_top_builddir)/src/qpidd $(srcdir)/verify_all
-check-local: all-local $(VERIFY_FILES)
- PYTHON_EXAMPLES=$(abs_top_srcdir)/../python/examples $(srcdir)/verify_all $(srcdir)/verify $(top_builddir)/src/qpidd examples
+check-local: all-local
+ $(srcdir)/verify_all $(abs_top_srcdir) $(abs_top_builddir)
# TODO:
# create a tarball for testing installed examples.
diff --git a/cpp/examples/verify b/cpp/examples/verify
deleted file mode 100755
index 844e99b765..0000000000
--- a/cpp/examples/verify
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/sh
-# Driver script to verify installed examples (also used for build tests.)
-#
-# Usage: verify example_dir [ example_dir ...]
-# Where each example_dir must contain a verify sub-script to include.
-#
-# If $QPIDD is set, run a private QPIDD and use it.
-# If $QPID_HOST or $QPID_PORT are set, use them to connect.
-#
-
-export QPID_DATA_DIR=
-
-cleanup() {
- test -n "$QPIDD" && $QPIDD -q # Private broker
- kill %% > /dev/null 2>&1 # Leftover background jobs
-}
-
-trap cleanup EXIT
-
-ARGS="${QPID_HOST:-localhost} $QPID_PORT"
-
-outfile() { echo $1.out; }
-
-fail() { test -n "$*" && echo $* 1>&2 ; FAIL=1; return 1; }
-
-client() { "$@" $ARGS > `outfile $*` || fail; }
-
-clients() { for cmd in "$@"; do client $cmd; done; }
-
-waitfor() { until grep -a -l "$2" $1 >/dev/null 2>&1 ; do sleep 1 ; done ; }
-
-background() {
- pattern=$1; shift
- out=`outfile $*`
- eval "$* $ARGS > $out &" || { fail; return 1; }
- waitfor $out "$pattern"
-}
-
-name() {
- for x in $*; do name="$name `basename $x`"; done
- echo $name;
-}
-
-outputs() {
- wait 2> /dev/null # Wait for all backgroud processes to complete
- rm -f $script.out
- for f in "$@"; do
- { echo "==== `name $f`"; eval "cat $f"; } >> $script.out || fail
- done
-}
-
-verify() {
- FAIL=
- if [ -d $1 ]; then dir=$1; script=verify;
- else dir=`dirname $1`; script=`basename $1`; fi
- cd $dir || return 1
- rm -f *.out
- { source ./$script && diff -ac $script.out $script.in ; } || fail
- test -z "$FAIL" && rm -f *.out
- return $FAIL
-}
-
-HEX="[a-fA-F0-9]"
-remove_uuid() {
- sed "s/$HEX\{8\}-$HEX\{4\}-$HEX\{4\}-$HEX\{4\}-$HEX\{12\}//g" $*
-}
-remove_uuid64() {
- sed 's/[-A-Za-z0-9_]\{22\}==//g' $*
-}
-
-# Start private broker if QPIDD is set.
-if [ -n "$QPIDD" ] ; then
- export QPID_PORT=`$QPIDD -dp0` || { echo "Cannot start $QPIDD" ; exit 1; }
- trap "$QPIDD -q" EXIT
-fi
-
-for example in "$@"; do
- echo -n "$example : "
- if ( verify $example; ) then echo "PASS"; else echo "FAIL"; RET=1; fi
- done
-exit $RET
diff --git a/cpp/examples/verify_all b/cpp/examples/verify_all
index db1d6de783..3eb88c7718 100755
--- a/cpp/examples/verify_all
+++ b/cpp/examples/verify_all
@@ -1,13 +1,19 @@
#!/bin/sh
# Verify all C++/python example combinations.
#
-verify=$1; shift
-qpidd=$1; shift
-cpp=$1; shift
+
+src=$1 ; build=$2
+
+verify=$src/../bin/verify
+qpidd=$build/src/qpidd
+cpp=$build/examples/examples
+python=$src/../python
trap "$qpidd -q" exit
export QPID_PORT=`$qpidd -dp0 --data-dir ""`
-export PYTHON_EXAMPLES
+export PYTHON_EXAMPLES=$python/examples
+export PYTHONPATH=$python:$PYTHONPATH
+export AMQP_SPEC=$src/../specs/amqp.0-10-preview.xml
find="find $cpp"
test -d $PYTHON_EXAMPLES && find="$find $PYTHON_EXAMPLES"