Perl shebang portability changes
[ACE_TAO.git] / ACE / bin / PerlACE / TestTarget_VxWorks.pm
blob9780b80155bbc096d64841536f02c246d3edc4ac
1 #!/usr/bin/env perl
3 package PerlACE::TestTarget_VxWorks;
5 # ******************************************************************
6 # Description : Creates a PerlACE::ProcessVX
7 # Author : Chad Elliott
8 # Create Date : 6/20/2008
9 # ******************************************************************
11 # ******************************************************************
12 # Pragma Section
13 # ******************************************************************
14 use PerlACE::TestTarget;
16 use strict;
18 use PerlACE::ProcessVX;
19 use Cwd;
20 use English;
22 our @ISA = qw(PerlACE::TestTarget);
24 # ******************************************************************
25 # Subroutine Section
26 # ******************************************************************
28 sub LocalFile {
29 my($self, $file) = @_;
30 if (defined $ENV{'ACE_TEST_VERBOSE'}) {
31 print STDERR "LocalFile is $file\n";
33 return $file;
36 sub AddLibPath ($) {
37 my $self = shift;
38 my $dir = shift;
39 if (defined $ENV{'ACE_TEST_VERBOSE'}) {
40 print STDERR "Adding libpath $dir\n";
42 PerlACE::add_lib_path ($dir);
45 sub CreateProcess {
46 my $self = shift;
47 my $process = new PerlACE::ProcessVX (@_);
48 $process->{TARGET} = $self;
49 return $process;
52 # Need a reboot when this target is destroyed.
53 sub NeedReboot ($)
55 my $self = shift;
56 $self->{REBOOT_NEEDED} = 1;
59 # Reboot target
60 sub RebootNow ($)
62 my $self = shift;
63 $self->{REBOOT_NEEDED} = undef;
64 print STDERR "Attempting to reboot target...\n";
65 reboot ();
68 sub WaitForFileTimed ($)
70 my $self = shift;
71 my $file = shift;
72 my $timeout = shift;
73 my $cwdrel = $file;
74 my $prjroot = defined $ENV{'ACE_RUN_VX_PRJ_ROOT'} ? $ENV{'ACE_RUN_VX_PRJ_ROOT'} : $ENV{'ACE_ROOT'};
75 if (length ($cwdrel) > 0) {
76 $cwdrel = File::Spec->abs2rel( cwd(), $prjroot );
78 else {
79 $cwdrel = File::Spec->abs2rel( $cwdrel, $prjroot );
81 my $newfile = $self->{HOST_ROOT} . "/" . $cwdrel . "/" . $file;
82 return PerlACE::waitforfile_timed ($newfile, $timeout);
85 sub KillAll ($)
87 my $self = shift;
88 my $procmask = shift;
89 PerlACE::ProcessVX::kill_all ($procmask, $self);