summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Simple_Naming/run_test.pl
blob: 1ec471a68de9f1b890538cd1af0e47c25745c58a (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
60
61
62
63
64
65
66
67
# $Id$
# -*- perl -*-
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
    & eval 'exec perl -S $0 $argv:q'
    if 0;

# This is a Perl script that runs the client and all the other servers that
# are needed

unshift @INC, '../../../../bin';
require Process;
require Uniqueid;

# amount of delay between running the servers

$sleeptime = 8;

# variables for parameters

$nsmport = 10000 + uniqueid ();

sub name_server
{
  my $args = "-ORBnameserviceport $nsmport";
  my $prog = "..$DIR_SEPARATOR..$DIR_SEPARATOR"."Naming_Service".$DIR_SEPARATOR.
             "Naming_Service".$Process::EXE_EXT;

  $NS = Process::Create ($prog, $args);
}

sub client
{
  my $args = $_[0]." "."-ORBnameserviceport $nsmport";
  my $prog = "client".$Process::EXE_EXT;
    
  system ($prog." ".$args);
}

# Options for all tests recognized by the 'client' program. 
@opts = ("-s", "-t", "-i", "-e");

@comments = ("Simple Test: \n", 
	     "Tree Test: \n",
	     "Iterator Test: \n",
	     "Exceptions Test: \n");

$test_number = 0;

# Run server and client with each option available to the client.
foreach $o (@opts)
{
  name_server ();

  sleep $sleeptime;
  print "\n";
  print "          ".$comments[$test_number];

  client ($o);

  $NS->Kill ();
  $test_number++;
}

print "\n";

# @@ Capture any exit status from the processes.
exit 0;