diff options
| author | Stephen D. Huston <shuston@apache.org> | 2009-10-05 16:00:59 +0000 |
|---|---|---|
| committer | Stephen D. Huston <shuston@apache.org> | 2009-10-05 16:00:59 +0000 |
| commit | ae074a2954fe5bb98a3d029e82690fa569470414 (patch) | |
| tree | 1ef15802a1860ae82fad73bbbd7762c6dc1f843e /cpp/src/tests/topictest.ps1 | |
| parent | 4f80172fc8a66475045df2299b45c4eb6d46a1b2 (diff) | |
| download | qpid-python-ae074a2954fe5bb98a3d029e82690fa569470414.tar.gz | |
Correct some powershell problems for Windows
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@821887 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/topictest.ps1')
| -rw-r--r-- | cpp/src/tests/topictest.ps1 | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/cpp/src/tests/topictest.ps1 b/cpp/src/tests/topictest.ps1 index 04dae23ad9..58ae50c67c 100644 --- a/cpp/src/tests/topictest.ps1 +++ b/cpp/src/tests/topictest.ps1 @@ -19,9 +19,6 @@ # Run the C++ topic test -# Clean up old log files -Get-Item subscriber_*.log | Remove-Item - # Parameters with default values: s (subscribers) m (messages) b (batches) # h (host) t (false; use transactions) param ( @@ -32,23 +29,28 @@ param ( [switch] $t # transactional ) +# Clean up old log files +Get-Item subscriber_*.log | Remove-Item + +if ($t) { + $transactional = "--transactional --durable" +} + function subscribe { - "Start subscriber $args[0]" - $LOG = "subscriber_$args[0].log" - . $srcdir\background.ps1 { - $env:OUTDIR\topic_listener $TRANSACTIONAL > $LOG 2>&1 - if ($LastExitCode -ne 0) { Remove-Item $LOG } - } -inconsole + param ([int]$num) + "Start subscriber $num" + $LOG = "subscriber_$num.log" + $cmdline = "$env:OUTDIR\topic_listener $transactional > $LOG 2>&1 + if (`$LastExitCode -ne 0) { Remove-Item $LOG }" + $cmdblock = $executioncontext.invokecommand.NewScriptBlock($cmdline) + . $srcdir\background.ps1 $cmdblock } -publish() { - if ($t) { - $transactional = "--transactional --durable" - } - $env:OUTDIR\topic_publisher --messages $messages --batches $batches --subscribers $subscribers $host $transactional 2>&1 +function publish { + Invoke-Expression "$env:OUTDIR\topic_publisher --messages $messages --batches $batches --subscribers $subscribers $host $transactional" 2>&1 } -$srcdir = Split-Path $myInvocation.ScriptName +$srcdir = Split-Path $MyInvocation.MyCommand.Path if ($broker.length) { $broker = "-h$broker" } |
