qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r882306 - in /qpid/trunk/qpid/cpp/src/tests: run_cluster_tests test_env.sh
Date Thu, 19 Nov 2009 21:31:17 GMT
Author: aconway
Date: Thu Nov 19 21:31:17 2009
New Revision: 882306

URL: http://svn.apache.org/viewvc?rev=882306&view=rev
Log:
Cleaned up test environment script.

Added:
    qpid/trunk/qpid/cpp/src/tests/test_env.sh   (with props)
Modified:
    qpid/trunk/qpid/cpp/src/tests/run_cluster_tests

Modified: qpid/trunk/qpid/cpp/src/tests/run_cluster_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_cluster_tests?rev=882306&r1=882305&r2=882306&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_cluster_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/run_cluster_tests Thu Nov 19 21:31:17 2009
@@ -19,24 +19,10 @@
 # under the License.
 #
 
-absdir() { echo `cd $1; pwd`; }
-srcdir=$(absdir $(dirname $0))
-top_builddir=$(absdir ../..)
+srcdir=$(dirname $0)
 
-. $srcdir/python_env.sh
-export PYTHONPATH=${srcdir}:${PYTHONPATH}
-export QPIDD_EXEC=${top_builddir}/src/qpidd
-export CLUSTER_LIB=${top_builddir}/src/.libs/cluster.so
-export QPID_CONFIG_EXEC=${srcdir}/../../../python/commands/qpid-config
-export QPID_ROUTE_EXEC=${srcdir}/../../../python/commands/qpid-route
-export RECEIVER_EXEC=${top_builddir}/src/tests/receiver
-export SENDER_EXEC=${top_builddir}/src/tests/sender
-
-# Check XML exchange requirements
-XML_LIB=$srcdir/../.libs/xml.so
-test -f ${XML_LIB} && export XML_LIB
-
-# Check AIS requirements
+. $srcdir/test_env.sh checkout $srcdir/../../.. ../.. || exit 1
+PYTHONPATH=$srcdir:$PYTHONPATH
 . $srcdir/ais_check
 
 # Delete old cluster test data
@@ -49,6 +35,6 @@
 CLUSTER_TESTS=${CLUSTER_TESTS:-$*}
 
 set -x
-with_ais_group $PYTHON_COMMANDS/qpid-python-test -DOUTDIR=$OUTDIR -m cluster_tests $CLUSTER_TESTS_IGNORE
$CLUSTER_TESTS || exit 1
+with_ais_group $QPID_PYTHON_COMMANDS/qpid-python-test -DOUTDIR=$OUTDIR -m cluster_tests $CLUSTER_TESTS_IGNORE
$CLUSTER_TESTS || exit 1
 rm -rf $OUTDIR
 #exit 0

Added: qpid/trunk/qpid/cpp/src/tests/test_env.sh
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/test_env.sh?rev=882306&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/test_env.sh (added)
+++ qpid/trunk/qpid/cpp/src/tests/test_env.sh Thu Nov 19 21:31:17 2009
@@ -0,0 +1,51 @@
+# Set up env var required by various tests.
+# If run without args, assume the current directory
+# 
+# source test_env.sh checkout|install dir1 [ dir2 ]
+#  checkout: dir1 is qpid dir of svn checkout, optional dir2 is cpp build directory
+#  install: dir1 is the install prefix
+
+usage() { echo "Usage: $0 checkout|install dir1 [ dir2 ]"; return 1; }
+absdir() { echo `cd $1 && pwd`; }
+
+qpid_checkout_env() {
+    QPID_ROOT=$(absdir $1)
+    if [ -n $2 ]; then QPID_BUILD=$(absdir $2); else QPID_BUILD=$QPID_ROOT/cpp; fi
+
+    export QPID_PYTHON_COMMANDS=$QPID_BUILD/src/tests/python/commands
+    export PYTHONPATH=$QPID_BUILD/src/tests/python:$QPID_PYTHON_COMMANDS:$PYTHONPATH
+    export QPIDD_EXEC=$QPID_BUILD/src/qpidd
+    export QPID_TEST_EXEC_DIR=$QPID_BUILD/src/tests
+    export QPID_MODULE_DIR=$QPID_BUILD/src/.libs/
+}
+
+qpid_install_env() {
+    QPID_PREFIX=$(absdir $1)
+
+    export QPID_PYTHON_COMMANDS=$QPID_PREFIX/bin
+    export PYTHONPATH=$QPID_PREFIX/python:$QPID_PYTHON_COMMANDS:$PYTHONPATH
+    export QPIDD_EXEC=$QPID_PREFIX/sbin/qpidd
+    export QPID_TEST_EXEC_DIR=$QPID_PREFIX/libexec/qpid/tests
+    if [ test -d $QPID_PREFIX/lib64/qpid ]; then export QPID_MODULE_DIR=$PREFIX/lib64/qpid;
+    elif [ test -d $QPID_PREFIX/lib/qpid ]; then export QPID_MODULE_DIR=$PREFIX/lib/qpid;
+    else echo "Can't find module directory $QPID_PREFIX/lib[64]/qpid";
+    fi
+}
+
+test $# -ge 2 || { usage; return 1; }
+
+case $1 in
+    checkout) qpid_checkout_env $2 $3 ;;
+    install) qpid_install_env $2 ;;
+    *) usage; return 1 ;;
+esac
+
+export QPID_CONFIG_EXEC=$QPID_PYTHON_COMMANDS/qpid-config
+export QPID_ROUTE_EXEC=$QPID_PYTHON_COMMANDS/qpid-route
+export QPID_CLUSTER_EXEC=$QPID_PYTHON_COMMANDS/qpid-cluster
+
+export RECEIVER_EXEC=$QPID_TEST_EXEC_DIR/receiver
+export SENDER_EXEC=$QPID_TEST_EXEC_DIR/sender
+
+test -f $QPID_MODULE_DIR/cluster.so && export CLUSTER_LIB=$QPID_MODULE_DIR/cluster.so
+test -f $QPID_MODULE_DIR/xml.so && export XML_LIB=$QPID_LIB_DIR/xml.so

Propchange: qpid/trunk/qpid/cpp/src/tests/test_env.sh
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message