summaryrefslogtreecommitdiff
path: root/TAO/tests/DynAny_Test/run_test.pl
blob: a407b04ce1c2e0a0f7c423cc18d7c68221851954 (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
68
69
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
    & eval 'exec perl -S $0 $argv:q'
    if 0;

# $Id$
# -*- perl -*-

use lib "../../../bin";
require ACEutils;
require Process;

$type = "";

sub run_test
{
  my $type = shift(@_);

  $BT = Process::Create ($EXEPREFIX."basic_test".$EXE_EXT,
			 " -t $type");

  $test = $BT->TimedWait (10);
  if ($test == -1) {
    print STDERR "ERROR: test timedout\n";
    $BT->Kill (); $BT->TimedWait (1);
  }

}

# Parse the arguments

for ($i = 0; $i <= $#ARGV; $i++)
{
  SWITCH:
  {
    if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?")
    {
      print "Run_Test Perl script for TAO DynAny Test\n\n";
      print "run_test [-t type]\n";
      print "\n";
      print "-t type             -- runs only one type of dynany test\n";
      exit;
    }
    if ($ARGV[$i] eq "-t")
    {
      $type = $ARGV[$i + 1];
      $i++;
      last SWITCH;
    }
  }
}

@types = ("dynany", "dynarray", "dynenum", "dynsequence", "dynstruct",
          "dynunion");



if ($type ne "")
{
  run_test ($type);
}
else
{
  foreach $type (@types)
  {
    run_test ($type);
  }
}