From 6f1199fe6abf7669b9c3552503a4701686488c01 Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Sun, 5 Mar 2017 16:45:28 +0100 Subject: Improvements for Android AVD testing. --- ACE/bin/PerlACE/Process_Unix.pm | 14 ++++---------- ACE/bin/PerlACE/TestTarget.pm | 28 +++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/ACE/bin/PerlACE/Process_Unix.pm b/ACE/bin/PerlACE/Process_Unix.pm index 118e149479f..487a2880abb 100644 --- a/ACE/bin/PerlACE/Process_Unix.pm +++ b/ACE/bin/PerlACE/Process_Unix.pm @@ -353,16 +353,10 @@ sub CommandLine () if (defined $ENV{'ACE_TEST_VERBOSE'}) { print STDERR "INFO: created run script [",$self->{SCRIPTFILE},"]\n", $run_script; } - if (defined $self->{TARGET} && - (defined $self->{TARGET}->{TARGET_FSROOT} || - defined $self->{TARGET}->{TEST_ROOT})) { - # Already written to proper dir - } else { - if ($self->{TARGET}->PutFile ($self->{SCRIPTFILE}) == -1) { - print STDERR "ERROR: Failed to copy <", $self->{SCRIPTFILE}, - "> to target \n"; - return -1; - } + if ($self->{TARGET}->PutFile ($self->{SCRIPTFILE}) == -1) { + print STDERR "ERROR: Failed to copy <", $self->{SCRIPTFILE}, + "> to target \n"; + return -1; } $commandline = "$shell \"source $tgt_exedir/".basename ($self->{SCRIPTFILE})."\""; diff --git a/ACE/bin/PerlACE/TestTarget.pm b/ACE/bin/PerlACE/TestTarget.pm index 6cea0d96b74..f37529cdf0d 100644 --- a/ACE/bin/PerlACE/TestTarget.pm +++ b/ACE/bin/PerlACE/TestTarget.pm @@ -47,7 +47,7 @@ sub create_target } my $config_os = $ENV{$envname}; SWITCH: { - if ($config_os =~ m/local|remote/i) { + if ($config_os =~ m/local|remote|avd/i) { $target = new PerlACE::TestTarget ($config_name); last SWITCH; } @@ -200,8 +200,8 @@ sub GetConfigSettings ($) } if ($fs_root ne $tgt_fs_root) { - $self->{HOST_FSROOT} = dirname ($fs_root); - $self->{TARGET_FSROOT} = dirname ($tgt_fs_root); + $self->{HOST_FSROOT} = $fs_root; + $self->{TARGET_FSROOT} = $tgt_fs_root; } $env_name = $env_prefix.'EXE_SUBDIR'; @@ -313,6 +313,14 @@ sub GetConfigSettings ($) if (exists $ENV{$env_name}) { $self->{REMOTE_SHELL} = $ENV{$env_name}; } + $env_name = $env_prefix.'PUT_CMD'; + if (exists $ENV{$env_name}) { + $self->{PUT_CMD} = $ENV{$env_name}; + } + $env_name = $env_prefix.'GET_CMD'; + if (exists $ENV{$env_name}) { + $self->{GET_CMD} = $ENV{$env_name}; + } $env_name = $env_prefix.'LIBPATH'; if (exists $ENV{$env_name}) { $self->{LIBPATH} = $ENV{$env_name}; @@ -547,7 +555,12 @@ sub GetFile ($) $local_file = $remote_file; $remote_file = $self->LocalFile($local_file); } - if (($remote_file ne $local_file) && + if (defined $self->{GET_CMD}) { + if (system ($self->{GET_CMD}.' '.$remote_file.' '.$local_file) != 0) { + print STDERR "ERROR executing [".$self->{GET_CMD}." $remote_file $local_file]\n"; + } + } + elsif (($remote_file ne $local_file) && (File::Spec->rel2abs($remote_file) ne File::Spec->rel2abs($local_file))) { copy ($remote_file, $local_file); } @@ -560,7 +573,12 @@ sub PutFile ($) my $self = shift; my $src = shift; my $dest = $self->LocalFile ($src); - if (($src ne $dest) && + if (defined $self->{PUT_CMD}) { + if (system ($self->{PUT_CMD}.' '.$src.' '.$dest) != 0) { + print STDERR "ERROR executing [".$self->{PUT_CMD}." $src $dest]\n"; + } + } + elsif (($src ne $dest) && (File::Spec->rel2abs($src) ne File::Spec->rel2abs($dest))) { copy ($src, $dest); } -- cgit v1.2.1