summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2010-03-05 00:09:25 +0000
committerStephen D. Huston <shuston@apache.org>2010-03-05 00:09:25 +0000
commitf1b38c23fcecc1c891ab7236bcb615d9a518b3e4 (patch)
tree4893c0150f7af33cbe2a2c0686294e99cbc0160b /cpp
parent677c5a585481a52f3aa216030abcac994ed669eb (diff)
downloadqpid-python-f1b38c23fcecc1c891ab7236bcb615d9a518b3e4.tar.gz
Fix to run topictest correctly on Windows.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@919240 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/tests/quick_topictest.ps14
-rw-r--r--cpp/src/tests/topictest.ps119
2 files changed, 13 insertions, 10 deletions
diff --git a/cpp/src/tests/quick_topictest.ps1 b/cpp/src/tests/quick_topictest.ps1
index b2efbdd684..8f5b2caff7 100644
--- a/cpp/src/tests/quick_topictest.ps1
+++ b/cpp/src/tests/quick_topictest.ps1
@@ -20,11 +20,11 @@
# Quick and quiet topic test for make check.
[string]$me = $myInvocation.InvocationName
$srcdir = Split-Path $me
-& "$srcdir\topictest.ps1" -subscribers 2 -messages 2 -batches 1 > topictest.log 2>&1
+Invoke-Expression "$srcdir\topictest.ps1 -subscribers 2 -messages 2 -batches 1" > topictest.log 2>&1
if (!$?) {
"$me FAILED:"
cat topictest.log
- exit $LastExitCode
+ exit 1
}
Remove-Item topictest.log
exit 0
diff --git a/cpp/src/tests/topictest.ps1 b/cpp/src/tests/topictest.ps1
index 0d22cea657..59a483c2d5 100644
--- a/cpp/src/tests/topictest.ps1
+++ b/cpp/src/tests/topictest.ps1
@@ -17,19 +17,21 @@
# under the License.
#
-# Run the C++ topic test
-$srcdir = Split-Path $myInvocation.InvocationName
-
# Parameters with default values: s (subscribers) m (messages) b (batches)
# h (host) t (false; use transactions)
param (
[int]$subscribers = 10,
- [int]$messages = 2000,
+ [int]$message_count = 2000,
[int]$batches = 10,
[string]$broker,
[switch] $t # transactional
)
+# Run the C++ topic test
+[string]$me = $myInvocation.InvocationName
+$srcdir = Split-Path $me
+#$srcdir = Split-Path $myInvocation.InvocationName
+
# Clean up old log files
Get-Item subscriber_*.log | Remove-Item
@@ -41,7 +43,7 @@ if ($t) {
. $srcdir\find_prog.ps1 .\topic_listener.exe
function subscribe {
- param ([int]$num)
+ param ([int]$num, [string]$sub)
"Start subscriber $num"
$LOG = "subscriber_$num.log"
$cmdline = ".\$sub\topic_listener $transactional > $LOG 2>&1
@@ -51,7 +53,8 @@ function subscribe {
}
function publish {
- Invoke-Expression ".\$sub\topic_publisher --messages $messages --batches $batches --subscribers $subscribers $host $transactional" 2>&1
+ param ([string]$sub)
+ Invoke-Expression ".\$sub\topic_publisher --messages $message_count --batches $batches --subscribers $subscribers $host $transactional" 2>&1
}
if ($broker.length) {
@@ -60,11 +63,11 @@ if ($broker.length) {
$i = $subscribers
while ($i -gt 0) {
- subscribe $i
+ subscribe $i $sub
$i--
}
# FIXME aconway 2007-03-27: Hack around startup race. Fix topic test.
Start-Sleep 2
-publish
+publish $sub
exit $LastExitCode