summaryrefslogtreecommitdiff
path: root/TAO/DevGuideExamples/GettingStarted/run_test.pl
blob: 9f97271d6b799ad0db54334491d693659ef5e3e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# $Id$

eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
    & eval 'exec perl -S $0 $argv:q'
    if 0;

use Env (ACE_ROOT);
use lib "$ACE_ROOT/bin";
use PerlACE::Run_Test;

$ior = PerlACE::LocalFile ("Messenger.ior");
unlink $ior;

# start MessengerServer

$S = new PerlACE::Process("MessengerServer");
$S->Spawn();

if (PerlACE::waitforfile_timed ($ior, $PerlACE::wait_interval_for_process_creation) == -1) {
    print STDERR "ERROR: cannot find file <$ior>\n";
    $S->Kill();
    unlink $ior;
    exit 1;
}

# start MessengerClient

$C = new PerlACE::Process("MessengerClient");
$C->Spawn();

$CRET = $C->WaitKill(15);
$S->Kill();

# clean-up

unlink $ior;

if ($CRET != 0) {
    print STDERR "ERROR: Client returned <$CRET>\n";
    exit 1 ;
}

exit 0;