Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Bug_1635_Regression / run_test.pl
blob550769deae82c4d0e652e9aa134b57c1055e34dd
1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
3 if 0;
5 # -*- perl -*-
7 use lib "$ENV{ACE_ROOT}/bin";
8 use PerlACE::TestTarget;
10 $status = 0;
11 $debug_level = '10';
13 foreach $i (@ARGV) {
14 if ($i eq '-debug') {
15 $debug_level = '10';
19 my $client = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
21 my $debug_log = "debug.log";
23 $client_log = $client->LocalFile ($debug_log);
24 $client->DeleteFile ($debug_log);
26 $CL = $client->CreateProcess ("client", "-ORBDebugLevel $debug_level -ORBLogFile $client_log");
28 sub run_client{
29 # Run the client
30 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
32 if ($client_status != 0) {
33 print STDERR "ERROR: client returned $client_status\n";
34 $status = 1;
37 # Open the log file, read a line, close, and delete it.
38 open (HANDLE, "$client_log");
39 $_ = <HANDLE>;
40 close HANDLE;
41 $client->DeleteFile ($debug_log);
44 # Run the client with no value for the environment variable
45 $ENV {'ACE_LOG_TIMESTAMP'} = "";
46 run_client;
48 # Check result is as expected, i.e. starts like:
49 # TAO (12...etc.
50 if (!/^TAO \(/){
51 print STDERR "ERROR: Bug 1635 Regression failed. Unexpected normal log format.\n";
52 $ENV {'ACE_LOG_TIMESTAMP'} = "";
53 exit 1;
56 # Try again with the 'TIME' logging property set
57 $ENV {'ACE_LOG_TIMESTAMP'} = "TIME";
58 run_client;
60 # Check result is as expected, i.e. starts like:
61 # 14:36:38.222000|TAO (12...etc.
62 if (!/^\d{2}:\d{2}:\d{2}.\d{6}\|TAO \(/){
63 print STDERR "ERROR: Bug 1635 Regression failed. Unexpected 'TIME' log format.\n";
64 $ENV {'ACE_LOG_TIMESTAMP'} = "";
65 exit 1;
68 # Try again with the 'DATE' logging property set
69 $ENV {'ACE_LOG_TIMESTAMP'} = "DATE";
70 run_client;
72 # Check result is as expected, i.e. starts like:
73 # Wed Feb 12 2003 14:36:38.222000|TAO (12...etc.
74 if (!/^[A-Z][a-z]{2} [A-Z][a-z]{2} \d{2} \d{4} \d{2}:\d{2}:\d{2}.\d{6}\|TAO \(/){
75 print STDERR "ERROR: Bug 1635 Regression failed. Unexpected 'DATE' log format.\n";
76 $ENV {'ACE_LOG_TIMESTAMP'} = "";
77 exit 1;
80 $ENV {'ACE_LOG_TIMESTAMP'} = "";
82 exit 0;