summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/run_cli_tests
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2010-01-07 20:32:09 +0000
committerTed Ross <tross@apache.org>2010-01-07 20:32:09 +0000
commitb29c80a3cdb99fc84fad8348eb298ac16d5b177f (patch)
treefc479208a56b46b87d743fe2e2e4496069e6b4a7 /qpid/cpp/src/tests/run_cli_tests
parentba099abbd256ad5a491c0529f85cb95ecd59a15e (diff)
downloadqpid-python-b29c80a3cdb99fc84fad8348eb298ac16d5b177f.tar.gz
QPID-2327 - Enhance qpid-config to deal with xml and headers brokers
Committed patch from John Dunning git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@897007 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/run_cli_tests')
-rwxr-xr-xqpid/cpp/src/tests/run_cli_tests35
1 files changed, 32 insertions, 3 deletions
diff --git a/qpid/cpp/src/tests/run_cli_tests b/qpid/cpp/src/tests/run_cli_tests
index 34ce3c4f1a..f3cdea0d4f 100755
--- a/qpid/cpp/src/tests/run_cli_tests
+++ b/qpid/cpp/src/tests/run_cli_tests
@@ -26,10 +26,39 @@ CLI_DIR=$PYTHON_COMMANDS
trap stop_brokers INT TERM QUIT
+# helper function to create test.xquery in the current directory, so
+# that the python test program can find it. yes, it leaves a turd.
+create_test_xquery() {
+ cat <<EOF > ./test.xquery
+ let \$w := ./weather
+ return \$w/station = 'Raleigh-Durham International Airport (KRDU)'
+ and \$w/temperature_f > 50
+ and \$w/temperature_f - \$w/dewpoint > 5
+ and \$w/wind_speed_mph > 7
+ and \$w/wind_speed_mph < 20
+EOF
+}
+
start_brokers() {
- ../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no > qpidd.port
+ # if the xml lib is present, use it. if not, disable any tests which
+ # look like they're xml related.
+ # if we start supporting xml on windows, it will need something similar
+ # here
+ if [ -f ../.libs/xml.so ] ; then
+ xargs="--load-module ../.libs/xml.so"
+ if [ ! -f test.xquery ] ; then
+ create_test_xquery
+ fi
+ targs=""
+ else
+ echo "Ignoring XML tests"
+ xargs=""
+ targs="--ignore=*xml*"
+ fi
+
+ ../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no $xargs > qpidd.port
LOCAL_PORT=`cat qpidd.port`
- ../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no > qpidd.port
+ ../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no $xargs > qpidd.port
REMOTE_PORT=`cat qpidd.port`
}
@@ -41,7 +70,7 @@ stop_brokers() {
if test -d ${PYTHON_DIR} ; then
start_brokers
echo "Running CLI tests using brokers on ports $LOCAL_PORT $REMOTE_PORT"
- $PYTHON_COMMANDS/qpid-python-test -m cli_tests -b localhost:$LOCAL_PORT -Dremote-port=$REMOTE_PORT -Dcli-dir=$CLI_DIR $@
+ $PYTHON_COMMANDS/qpid-python-test -m cli_tests -b localhost:$LOCAL_PORT -Dremote-port=$REMOTE_PORT -Dcli-dir=$CLI_DIR $targs $@
RETCODE=$?
stop_brokers
if test x$RETCODE != x0; then