summaryrefslogtreecommitdiff
path: root/modules/CIAO/tests/Bug_3832_Regression/run_test.pl
blob: 087bf3ca8b98e9e74990de8b1a1ecc7c80b42cd8 (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
47
48
49
50
51
52
53
54
55
56
57
58
59

# $Id$

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

# -*- perl -*-

use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::TestTarget;

$status =0;

my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";

# Generated code file names
my $TestCaseC_i = "test.log";

$server_TestCaseC_i = $server->LocalFile($TestCaseC_i);
$server->DeleteFile($TestCaseC_i);

$ENV {'CIAO_LOG_LEVEL'} = 10;
$ENV {'CIAO_LOG_FILE'} = 'test.log';

$SV = $server->CreateProcess ("../../bin/ciao_componentserver", "");

$SV->Spawn ();

if ($server->WaitForFileTimed ($TestCaseC_i,
                               $server->ProcessStartWaitInterval()) == -1) {
    print STDERR "ERROR: cannot find file <$server_TestCaseC_i\n";
    $SV->Kill (); $SV->TimedWait (1);
    exit 1;
}

$server_status = $SV->Kill ($server->ProcessStopWaitInterval());

# Test for the presence of LM_ERROR
$found = 0 ;
open (I_FILE, "$server_TestCaseC_i") ;
while( <I_FILE> ){
   chomp ;
   if( $_ =~ /LM_ERROR/ ){
       $found = 1 ;
       last ;
   }
}

if( $found != 1 ){
  print STDERR "ERROR: No logging found\n";
  $status = 1 ;
} else {
  print STDERR "Found logging\n";
}

$server->DeleteFile($TestCaseC_i);

exit $status;