summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsmit <msmit@remedy.nl>2011-09-23 09:22:53 +0000
committermsmit <msmit@remedy.nl>2011-09-23 09:22:53 +0000
commitff26f944433c690fb0d9bb8586786523fcb047f7 (patch)
tree378e8fe0a66e2a87403b83fd459dcbca10dc764f
parentd15edcb3d8820fd88d18d2f1e0fbae63fa31857d (diff)
downloadATCD-ff26f944433c690fb0d9bb8586786523fcb047f7.tar.gz
Fri Sep 23 09:25:04 UTC 2011 Marcel Smit <msmit@remedy.nl>
* bin/PerlACE/TestTarget_Android.pm: Stop the script when an emulator times out.
-rw-r--r--ACE/ChangeLog5
-rw-r--r--ACE/bin/PerlACE/TestTarget_Android.pm28
2 files changed, 29 insertions, 4 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index d2737667aed..5ef021bc589 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,8 @@
+Fri Sep 23 09:25:04 UTC 2011 Marcel Smit <msmit@remedy.nl>
+
+ * bin/PerlACE/TestTarget_Android.pm:
+ Stop the script when an emulator times out.
+
Wed Sep 14 07:54:28 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
* bin/PerlACE/TestTarget_Android.pm:
diff --git a/ACE/bin/PerlACE/TestTarget_Android.pm b/ACE/bin/PerlACE/TestTarget_Android.pm
index 5934dd1e74e..5889fca391e 100644
--- a/ACE/bin/PerlACE/TestTarget_Android.pm
+++ b/ACE/bin/PerlACE/TestTarget_Android.pm
@@ -198,12 +198,32 @@ sub start_target ()
}
}
- my $wait_cmd = $adb_process . ' wait-for-device';
- system ( $wait_cmd );
- if (defined $ENV{'ACE_TEST_VERBOSE'}) {
- print STDERR "Emulator is running <$self->{PROCESS}> -> start the tests.\n";
+ eval {
+ my $timeout = 30;
+ if (defined ($ENV{'ANDROID_SDK_ROOT'})) {
+ $timeout = $ENV{'DOC_TEST_DEFAULT_ADB_WAIT_FOR_DEVICE_TIMEOUT'};
+ }
+
+ local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required
+ alarm $timeout;
+ # start the waiting...
+ my $wait_cmd = $adb_process . ' wait-for-device';
+ system ( $wait_cmd );
+ # reset alarm
+ alarm 0;
+ };
+
+ if ($@) {
+ # timed out
+ exit unless $@ eq "alarm\n"; # propagate unexpected errors
+ }
+ else {
+ if (defined $ENV{'ACE_TEST_VERBOSE'}) {
+ print STDERR "Emulator is running <$self->{PROCESS}> -> start the tests.\n";
+ }
}
+
# AVD is up and running and ready to spawn executables.
# First some preparation.
my $cmd = $adb_process . ' shell "mkdir ' . $self->{FSROOT} . '/tmp "' . $silent;