author | Simon Howkins <simonh@symbian.org> |
Thu, 30 Sep 2010 17:39:10 +0100 | |
changeset 1241 | 92bfe0d10c29 |
parent 1091 | e29e83fc0026 |
permissions | -rw-r--r-- |
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
1 |
#!/usr/bin/perl |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
2 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
3 |
# Copyright (c) 2009 Symbian Foundation Ltd |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
4 |
# This component and the accompanying materials are made available |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
5 |
# under the terms of the License "Eclipse Public License v1.0" |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
6 |
# which accompanies this distribution, and is available |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
7 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
8 |
# |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
9 |
# Initial Contributors: |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
10 |
# Symbian Foundation Ltd - initial contribution. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
11 |
# Mike Kinghan, mikek@symbian.org |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
12 |
# |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
13 |
# Contributors: |
550
4128d08e7c08
Changed ats_specialise_testdrop and build.test.xml to use the 'HOST' device property to fix the devicem rather than the 'NAME' property
Brendan Donegan brendand@symbian.org
parents:
317
diff
changeset
|
14 |
# Brendan Donegan, brendand@symbian.org |
836
675529c38614
Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
823
diff
changeset
|
15 |
# Maciej Seroka, maciejs@symbian.org |
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
16 |
# |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
17 |
# Description: |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
18 |
# This is a tool for setting the name of an ATS test drop, and/or the build id |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
19 |
# of the build being tested, and/or the name of the device on which |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
20 |
# it is to be run, by modifying the XML test drop specificcation. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
21 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
22 |
use strict; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
23 |
use Getopt::Long; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
24 |
use XML::Simple; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
25 |
use File::Copy; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
26 |
use Data::Dumper; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
27 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
28 |
my $test_drop_name; # Test drop name to be embedded in output XML |
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
29 |
my $test_drop; |
550
4128d08e7c08
Changed ats_specialise_testdrop and build.test.xml to use the 'HOST' device property to fix the devicem rather than the 'NAME' property
Brendan Donegan brendand@symbian.org
parents:
317
diff
changeset
|
30 |
my $build_id; # Build ID to be embedded in output XML |
4128d08e7c08
Changed ats_specialise_testdrop and build.test.xml to use the 'HOST' device property to fix the devicem rather than the 'NAME' property
Brendan Donegan brendand@symbian.org
parents:
317
diff
changeset
|
31 |
my $host_name; # Host name to be embedded in output XML |
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
32 |
my $srcfile; # Input test drop file, either .xml or .zip |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
33 |
my $destfile; # Leafname for output file. Extension will be .xml or .zip as input. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
34 |
# If unspecified then the input file is updated. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
35 |
my $help; # Do help? |
550
4128d08e7c08
Changed ats_specialise_testdrop and build.test.xml to use the 'HOST' device property to fix the devicem rather than the 'NAME' property
Brendan Donegan brendand@symbian.org
parents:
317
diff
changeset
|
36 |
my $srctype; # Type of input file, .xml or .zip |
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
37 |
my $dev_null = $^O =~ /^MSWin/ ? "nul" : "/dev/null"; # OS-dependent nul device. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
38 |
my $zipper; # Zip command, depending on whether zip or 7z is available. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
39 |
my $unzipper; # Unzip command, depending on whether [unzip or 7z is available. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
40 |
my $xml_in; # Name of the input xml file. Always 'test.xml' if extracted from zipped test drop. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
41 |
my $temp_dest_name; # Leafname of temporary output file, if $destfile undefined. |
820
2a9e6403efaf
Updated postbuild to publish smoketest results
Maciej Seroka <maciejs@symbian.org>
parents:
819
diff
changeset
|
42 |
my $publish; # Publishing folder for ats reports. |
836
675529c38614
Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
823
diff
changeset
|
43 |
my $bld_drive; # Subst'd drive |
986
95924ae2e0d6
Added ROM image parameters to ats_specialise_drop
Brendan Donegan <brendand@symbian.org>
parents:
836
diff
changeset
|
44 |
my $test_target; # The target which the tests will be run on |
95924ae2e0d6
Added ROM image parameters to ats_specialise_drop
Brendan Donegan <brendand@symbian.org>
parents:
836
diff
changeset
|
45 |
my $image_path; # The path to the ROM image used for testing (not valid for WINSCW target) |
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
46 |
my $ats_version; # The version of ATS used for running tests |
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
47 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
48 |
sub usage($); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
49 |
sub help(); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
50 |
sub usage_error(); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
51 |
sub silent_command($); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
52 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
53 |
my %optmap = ( 'test-drop-name' => \$test_drop_name, |
1018
f2c5bb4624be
Fixed ats_specialise_drop to insert ROM image parameters
Maciej Seroka <maciejs@symbian.org>
parents:
986
diff
changeset
|
54 |
'host-name' => \$host_name, |
f2c5bb4624be
Fixed ats_specialise_drop to insert ROM image parameters
Maciej Seroka <maciejs@symbian.org>
parents:
986
diff
changeset
|
55 |
'build-id' => \$build_id, |
f2c5bb4624be
Fixed ats_specialise_drop to insert ROM image parameters
Maciej Seroka <maciejs@symbian.org>
parents:
986
diff
changeset
|
56 |
'src' => \$srcfile, |
f2c5bb4624be
Fixed ats_specialise_drop to insert ROM image parameters
Maciej Seroka <maciejs@symbian.org>
parents:
986
diff
changeset
|
57 |
'dest' => \$destfile, |
836
675529c38614
Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
823
diff
changeset
|
58 |
'publish' => \$publish, |
1018
f2c5bb4624be
Fixed ats_specialise_drop to insert ROM image parameters
Maciej Seroka <maciejs@symbian.org>
parents:
986
diff
changeset
|
59 |
'bld-drive' => \$bld_drive, |
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
60 |
'test-target' => \$test_target, |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
61 |
'image-path' => \$image_path, |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
62 |
'ats-version' => \$ats_version, |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
63 |
'help' => \$help); |
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
64 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
65 |
GetOptions(\%optmap, |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
66 |
'test-drop-name=s', |
550
4128d08e7c08
Changed ats_specialise_testdrop and build.test.xml to use the 'HOST' device property to fix the devicem rather than the 'NAME' property
Brendan Donegan brendand@symbian.org
parents:
317
diff
changeset
|
67 |
'host-name=s', |
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
68 |
'build-id=s', |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
69 |
'src=s', |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
70 |
'dest=s', |
836
675529c38614
Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
823
diff
changeset
|
71 |
'publish=s', |
1018
f2c5bb4624be
Fixed ats_specialise_drop to insert ROM image parameters
Maciej Seroka <maciejs@symbian.org>
parents:
986
diff
changeset
|
72 |
'bld-drive=s', |
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
73 |
'test-target=s', |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
74 |
'image-path=s', |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
75 |
'ats-version=s', |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
76 |
'help!') |
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
77 |
or usage_error(); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
78 |
|
821
b24df46a3102
Implemented exporting Smoke Test Report to Diamonds
Maciej Seroka <maciejs@symbian.org>
parents:
820
diff
changeset
|
79 |
# Check if Tie::File module installed |
b24df46a3102
Implemented exporting Smoke Test Report to Diamonds
Maciej Seroka <maciejs@symbian.org>
parents:
820
diff
changeset
|
80 |
eval("use Tie::File"); |
836
675529c38614
Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
823
diff
changeset
|
81 |
if ($@) { $publish = ''; $bld_drive = ''; }; |
821
b24df46a3102
Implemented exporting Smoke Test Report to Diamonds
Maciej Seroka <maciejs@symbian.org>
parents:
820
diff
changeset
|
82 |
|
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
83 |
if ($help) { |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
84 |
help(); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
85 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
86 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
87 |
# --src is mandatory. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
88 |
usage_error(), unless (defined($srcfile)); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
89 |
if ($srcfile =~ /(\.xml$)/i) { |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
90 |
$srctype = lc($1); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
91 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
92 |
elsif ($srcfile =~ /(\.zip$)/i) { |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
93 |
$srctype = lc($1); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
94 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
95 |
else { |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
96 |
# src file must have extension .xml or .zip |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
97 |
usage_error(); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
98 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
99 |
die("File \"$srcfile\" does not exist"), unless -f $srcfile; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
100 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
101 |
if (!$destfile) { # dest file unspecified. We will update the src file. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
102 |
$temp_dest_name = "ats_specialise_test_drop.out"; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
103 |
$destfile = $temp_dest_name; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
104 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
105 |
else { |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
106 |
# If dest file has same extension as src then strip off, cos we'll append it anyway. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
107 |
$destfile =~ s/$srctype$//; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
108 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
109 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
110 |
if ($srctype =~ /^\.zip$/) { # Test drop is zip. Must contain test.xml. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
111 |
$xml_in = "test.xml"; # This is our input XML. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
112 |
if ( -f $xml_in) { |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
113 |
# Pre-emptively delete anystale xml file. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
114 |
unlink($xml_in) or die("Cannot delete stale $xml_in: $!\n"); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
115 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
116 |
if (!silent_command("zip -v")) { # See if we've got zip |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
117 |
$zipper = "zip -m $destfile.zip test.xml"; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
118 |
$unzipper = "unzip -o $srcfile $xml_in -d ."; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
119 |
} |
279 | 120 |
elsif (!silent_command("7z -h")) { # Else see if we've got 7zip |
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
121 |
$zipper = "7z u $destfile.zip test.xml"; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
122 |
$unzipper = "7z e $srcfile $xml_in"; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
123 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
124 |
else { # Got no archiver. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
125 |
die ("Need programs zip/unzip or 7z. Not found\n"); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
126 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
127 |
# Extract test.xml from zip. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
128 |
system("$unzipper > $dev_null") and die("Could not unzip \"$srcfile\"\n"); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
129 |
die("Did not find $xml_in within \"$srcfile\"\n"), unless( -f "$xml_in"); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
130 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
131 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
132 |
else { |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
133 |
$xml_in = $srcfile; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
134 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
135 |
|
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
136 |
# --test-target is not mandatory. |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
137 |
if (!defined($test_target)) { # Set winscw by default |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
138 |
$test_target = "winscw" |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
139 |
} |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
140 |
|
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
141 |
# --ats-version is not mandatory. |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
142 |
if (!defined($ats_version)) { # Set ats3 by default |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
143 |
$ats_version = "ats3" |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
144 |
} |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
145 |
|
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
146 |
# Parse the input XML into hashref. |
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
147 |
if (lc($ats_version) eq "ats4") { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
148 |
$test_drop = XMLin("./$xml_in", keeproot => 1, |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
149 |
forcearray => [ 'metadata', 'meta', 'agents', 'agent', 'property', 'postActions', 'action', 'type', 'parameters', 'parameter', 'execution', 'initialization', 'task', 'alias' ],# |
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
150 |
keyattr => [] ); |
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
151 |
} else { # ats3 format |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
152 |
$test_drop = XMLin("./$xml_in", keeproot => 1, |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
153 |
forcearray => [ 'name', 'id', 'owner', 'priority', 'buildid', 'postAction', 'type', 'target', 'device', 'property', 'command', 'param', 'plan', 'session', 'set', 'alias' ],# |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
154 |
keyattr => [] ); |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
155 |
} |
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
156 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
157 |
# Insert the specified test drop name, if any. |
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
158 |
if (lc($ats_version) eq "ats4") { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
159 |
# Assumption: meta 'name' exists in test plan |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
160 |
$test_drop->{'testrun'}->{'metadata'}->[0]->{'meta'}->[0] = { 'name' => "name", 'content' => $test_drop_name }, if $test_drop_name; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
161 |
} else { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
162 |
$test_drop->{'test'}->{'name'}->[0] = $test_drop_name, if $test_drop_name; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
163 |
} |
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
164 |
# Insert the specified build id, if any. |
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
165 |
if (lc($ats_version) eq "ats4") { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
166 |
if ($build_id) { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
167 |
my $meta_num = @{$test_drop->{'testrun'}->{'metadata'}->[0]->{'meta'}}; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
168 |
$test_drop->{'testrun'}->{'metadata'}->[0]->{'meta'}->[$meta_num]; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
169 |
$test_drop->{'testrun'}->{'metadata'}->[0]->{'meta'}->[$meta_num] = { 'name' => "diamonds-buildid", 'content' => $build_id }; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
170 |
$test_drop->{'testrun'}->{'metadata'}->[0]->{'meta'}->[$meta_num+1]; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
171 |
$test_drop->{'testrun'}->{'metadata'}->[0]->{'meta'}->[$meta_num+1] = { 'name' => "diamonds-testtype", 'content' => "Smoke" }; # Hard-coded Smoke |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
172 |
} |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
173 |
} else { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
174 |
$test_drop->{'test'}->{'buildid'}->[0] = $build_id, if $build_id; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
175 |
} |
986
95924ae2e0d6
Added ROM image parameters to ats_specialise_drop
Brendan Donegan <brendand@symbian.org>
parents:
836
diff
changeset
|
176 |
# Insert the path to the ROM image |
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
177 |
if (lc($ats_version) eq "ats4") { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
178 |
if (($image_path) && (lc($test_target) ne "winscw")) { |
1091
e29e83fc0026
Modified ats_specialise_test_drop to update FlashTask with the ROM image location
Maciej Seroka <maciejs@symbian.org>
parents:
1085
diff
changeset
|
179 |
# my $agent_alias = $test_drop->{'testrun'}->{'agents'}->[0]->{'agent'}->[0]->{'alias'}; |
e29e83fc0026
Modified ats_specialise_test_drop to update FlashTask with the ROM image location
Maciej Seroka <maciejs@symbian.org>
parents:
1085
diff
changeset
|
180 |
# my $task_num = @{$test_drop->{'testrun'}->{'execution'}->[0]->{'initialization'}->[0]->{'task'}}; |
e29e83fc0026
Modified ats_specialise_test_drop to update FlashTask with the ROM image location
Maciej Seroka <maciejs@symbian.org>
parents:
1085
diff
changeset
|
181 |
my $task_num = 0; # Assuming FlashTask is the first task in the initialization section |
e29e83fc0026
Modified ats_specialise_test_drop to update FlashTask with the ROM image location
Maciej Seroka <maciejs@symbian.org>
parents:
1085
diff
changeset
|
182 |
# $test_drop->{'testrun'}->{'execution'}->[0]->{'initialization'}->[0]->{'task'}->[$task_num]; |
e29e83fc0026
Modified ats_specialise_test_drop to update FlashTask with the ROM image location
Maciej Seroka <maciejs@symbian.org>
parents:
1085
diff
changeset
|
183 |
# $test_drop->{'testrun'}->{'execution'}->[0]->{'initialization'}->[0]->{'task'}->[$task_num] = { 'agents' => $agent_alias }; |
e29e83fc0026
Modified ats_specialise_test_drop to update FlashTask with the ROM image location
Maciej Seroka <maciejs@symbian.org>
parents:
1085
diff
changeset
|
184 |
# $test_drop->{'testrun'}->{'execution'}->[0]->{'initialization'}->[0]->{'task'}->[$task_num]->{'type'}->[0]; |
e29e83fc0026
Modified ats_specialise_test_drop to update FlashTask with the ROM image location
Maciej Seroka <maciejs@symbian.org>
parents:
1085
diff
changeset
|
185 |
# $test_drop->{'testrun'}->{'execution'}->[0]->{'initialization'}->[0]->{'task'}->[$task_num]->{'type'}->[0] = "FlashTask"; |
e29e83fc0026
Modified ats_specialise_test_drop to update FlashTask with the ROM image location
Maciej Seroka <maciejs@symbian.org>
parents:
1085
diff
changeset
|
186 |
# $test_drop->{'testrun'}->{'execution'}->[0]->{'initialization'}->[0]->{'task'}->[$task_num]->{'parameters'}->[0]; |
e29e83fc0026
Modified ats_specialise_test_drop to update FlashTask with the ROM image location
Maciej Seroka <maciejs@symbian.org>
parents:
1085
diff
changeset
|
187 |
# $test_drop->{'testrun'}->{'execution'}->[0]->{'initialization'}->[0]->{'task'}->[$task_num]->{'parameters'}->[0]->{'parameter'}->[0]; |
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
188 |
$test_drop->{'testrun'}->{'execution'}->[0]->{'initialization'}->[0]->{'task'}->[$task_num]->{'parameters'}->[0]->{'parameter'}->[0] = { 'name' => "image-1", 'value' => $image_path }; |
1091
e29e83fc0026
Modified ats_specialise_test_drop to update FlashTask with the ROM image location
Maciej Seroka <maciejs@symbian.org>
parents:
1085
diff
changeset
|
189 |
# $test_drop->{'testrun'}->{'execution'}->[0]->{'initialization'}->[0]->{'task'}->[$task_num]->{'parameters'}->[0]->{'parameter'}->[1]; |
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
190 |
$test_drop->{'testrun'}->{'execution'}->[0]->{'initialization'}->[0]->{'task'}->[$task_num]->{'parameters'}->[0]->{'parameter'}->[1] = { 'name' => "timeout", 'value' => "1200" }; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
191 |
} |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
192 |
} else { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
193 |
if (($image_path) && (lc($test_target) ne "winscw")) { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
194 |
my $device_alias; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
195 |
my $set_params; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
196 |
my $flash_params; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
197 |
foreach $set_params (@{$test_drop->{'test'}->{'plan'}->[0]->{'session'}->[0]->{'set'}}) { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
198 |
$device_alias = $set_params->{'target'}->[0]->{'device'}->[0]->{'alias'}; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
199 |
$set_params->{'flash'}->[0]; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
200 |
$flash_params = $set_params->{'flash'}; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
201 |
$flash_params->[0] = { 'target-alias' => $device_alias, 'images' => $image_path }; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
202 |
} |
1003
75c9a2f0ae9e
Modified ats_specialise_test_drop to automatically set test-target param based on device alias
Maciej Seroka <maciejs@symbian.org>
parents:
989
diff
changeset
|
203 |
} |
1018
f2c5bb4624be
Fixed ats_specialise_drop to insert ROM image parameters
Maciej Seroka <maciejs@symbian.org>
parents:
986
diff
changeset
|
204 |
} |
986
95924ae2e0d6
Added ROM image parameters to ats_specialise_drop
Brendan Donegan <brendand@symbian.org>
parents:
836
diff
changeset
|
205 |
|
819
3df98b3b0a8d
Updated ats_specialise_test_drop.pl to insert FileStoreAction param
Maciej Seroka <maciejs@symbian.org>
parents:
730
diff
changeset
|
206 |
# Insert the FileStoreAction parameter |
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
207 |
if (lc($ats_version) eq "ats4") { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
208 |
if ($publish) { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
209 |
my $action_num = @{$test_drop->{'testrun'}->{'postActions'}->[0]->{'action'}}; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
210 |
$test_drop->{'testrun'}->{'postActions'}->[0]->{'action'}->[$action_num]; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
211 |
$test_drop->{'testrun'}->{'postActions'}->[0]->{'action'}->[$action_num]->{'type'}->[0]; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
212 |
$test_drop->{'testrun'}->{'postActions'}->[0]->{'action'}->[$action_num]->{'type'}->[0] = "FileStoreAction"; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
213 |
$test_drop->{'testrun'}->{'postActions'}->[0]->{'action'}->[$action_num]->{'parameters'}->[0]; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
214 |
$test_drop->{'testrun'}->{'postActions'}->[0]->{'action'}->[$action_num]->{'parameters'}->[0]->{'parameter'}->[0]; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
215 |
$test_drop->{'testrun'}->{'postActions'}->[0]->{'action'}->[$action_num]->{'parameters'}->[0]->{'parameter'}->[0] = { 'name' => "dst", 'value' => $publish }; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
216 |
} |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
217 |
} else { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
218 |
if ($publish) { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
219 |
my $postaction_params = $test_drop->{'test'}->{'postAction'}->[0]->{'params'}->{'param'}; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
220 |
$postaction_params->[1] = { 'name' => "to-folder", 'value' => $publish }; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
221 |
} |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
222 |
} |
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
223 |
|
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
224 |
# Also insert specified host name |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
225 |
if (lc($ats_version) eq "ats4") { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
226 |
if ($host_name) { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
227 |
# Assumption: 'agent' element with 'property' exists in test plan |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
228 |
my $agent_name = uc($test_target) . " on " . $host_name; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
229 |
$test_drop->{'testrun'}->{'agents'}->[0]->{'agent'}->[0]->{'property'}->[0] = { 'name' => "name", 'value' => $agent_name }; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
230 |
} |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
231 |
} else { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
232 |
if ($host_name) { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
233 |
my $devices = $test_drop->{'test'}->{'target'}->[0]->{'device'}; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
234 |
|
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
235 |
foreach my $device (@{$devices}) { |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
236 |
my $device_properties = $device->{'property'}; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
237 |
my $num_properties = @{$device_properties}; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
238 |
|
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
239 |
$device_properties->[$num_properties] = { 'name' => "HOST", 'value' => "$host_name" }; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
240 |
$device->{'property'} = $device_properties; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
241 |
} |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
242 |
} |
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
243 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
244 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
245 |
if ($srctype =~ /^\.xml$/i ) { # Input file was XML |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
246 |
# Write new XML to dest file. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
247 |
open OUT,">$destfile.xml" or die("Cannot open file \"$destfile.xml\" for writing. $!\n"); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
248 |
print OUT XMLout($test_drop, keeproot => 1); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
249 |
close OUT; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
250 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
251 |
else { #Input file was a zip. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
252 |
# Write new XML to test.xml |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
253 |
open OUT,">test.xml" or die("Cannot open file \"test.xml\" for writing. $!\n"); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
254 |
print OUT XMLout($test_drop, keeproot => 1); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
255 |
close OUT; |
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
256 |
if (($publish) && (lc($ats_version) eq "ats3")) { #Move <type>FileStoreAction</type> above <params> |
821
b24df46a3102
Implemented exporting Smoke Test Report to Diamonds
Maciej Seroka <maciejs@symbian.org>
parents:
820
diff
changeset
|
257 |
my @lines; |
b24df46a3102
Implemented exporting Smoke Test Report to Diamonds
Maciej Seroka <maciejs@symbian.org>
parents:
820
diff
changeset
|
258 |
tie @lines, 'Tie::File', "test.xml" or die("Cannot tie file \"test.xml\". $!\n"); |
b24df46a3102
Implemented exporting Smoke Test Report to Diamonds
Maciej Seroka <maciejs@symbian.org>
parents:
820
diff
changeset
|
259 |
my $current_line = 0; |
b24df46a3102
Implemented exporting Smoke Test Report to Diamonds
Maciej Seroka <maciejs@symbian.org>
parents:
820
diff
changeset
|
260 |
for (@lines) { |
b24df46a3102
Implemented exporting Smoke Test Report to Diamonds
Maciej Seroka <maciejs@symbian.org>
parents:
820
diff
changeset
|
261 |
if (/FileStoreAction/) { |
b24df46a3102
Implemented exporting Smoke Test Report to Diamonds
Maciej Seroka <maciejs@symbian.org>
parents:
820
diff
changeset
|
262 |
my $line_to_move = @lines[$current_line]; |
b24df46a3102
Implemented exporting Smoke Test Report to Diamonds
Maciej Seroka <maciejs@symbian.org>
parents:
820
diff
changeset
|
263 |
splice @lines, $current_line, 1; |
b24df46a3102
Implemented exporting Smoke Test Report to Diamonds
Maciej Seroka <maciejs@symbian.org>
parents:
820
diff
changeset
|
264 |
splice @lines, $current_line-4, 0, $line_to_move; |
b24df46a3102
Implemented exporting Smoke Test Report to Diamonds
Maciej Seroka <maciejs@symbian.org>
parents:
820
diff
changeset
|
265 |
last; |
b24df46a3102
Implemented exporting Smoke Test Report to Diamonds
Maciej Seroka <maciejs@symbian.org>
parents:
820
diff
changeset
|
266 |
} |
b24df46a3102
Implemented exporting Smoke Test Report to Diamonds
Maciej Seroka <maciejs@symbian.org>
parents:
820
diff
changeset
|
267 |
$current_line++; |
b24df46a3102
Implemented exporting Smoke Test Report to Diamonds
Maciej Seroka <maciejs@symbian.org>
parents:
820
diff
changeset
|
268 |
} |
b24df46a3102
Implemented exporting Smoke Test Report to Diamonds
Maciej Seroka <maciejs@symbian.org>
parents:
820
diff
changeset
|
269 |
untie @lines; |
b24df46a3102
Implemented exporting Smoke Test Report to Diamonds
Maciej Seroka <maciejs@symbian.org>
parents:
820
diff
changeset
|
270 |
} |
836
675529c38614
Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
823
diff
changeset
|
271 |
if ($bld_drive) { #Replace D:\ATS\winscw_smoketest path with subst'd drive |
675529c38614
Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
823
diff
changeset
|
272 |
my @LINE; |
675529c38614
Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
823
diff
changeset
|
273 |
tie @LINE, 'Tie::File', "test.xml" or die("Cannot tie file \"test.xml\". $!\n"); |
675529c38614
Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
823
diff
changeset
|
274 |
for (@LINE) { |
675529c38614
Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
823
diff
changeset
|
275 |
s/D:\\ATS\\winscw_smoketest/$bld_drive/g; |
675529c38614
Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
823
diff
changeset
|
276 |
} |
675529c38614
Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
823
diff
changeset
|
277 |
untie @LINE; |
675529c38614
Added smoke test for making a connection to a web server through ethernet
Maciej Seroka <maciejs@symbian.org>
parents:
823
diff
changeset
|
278 |
} |
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
279 |
if ( -f "$destfile.zip") { |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
280 |
unlink("$destfile.zip") or die("Could not delete \"$destfile.zip\": $!\n"); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
281 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
282 |
copy("$srcfile","$destfile.zip") or die("Could not copy \"$srcfile\" -> \"$destfile.zip\": $!\n"); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
283 |
system("$zipper > $dev_null") and die("Could not zip \"test.xml\" into \"$destfile\"\n"); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
284 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
285 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
286 |
if ($temp_dest_name) { # We are to update the src file. dest file is a temporary. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
287 |
# Delete src file |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
288 |
unlink($srcfile) or die("Cannot delete file \"$srcfile\" to replace: $!\n"); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
289 |
# Replace with temporary. |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
290 |
move("$destfile$srctype","$srcfile") or die("Could not move \"$destfile$srctype\" -> \"$srcfile\": $!\n"); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
291 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
292 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
293 |
print "OK\n"; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
294 |
exit 0; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
295 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
296 |
sub usage($) |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
297 |
{ |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
298 |
my $error = shift; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
299 |
my $fh = $error == 0 ? *STDOUT : *STDERR; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
300 |
print $fh "ats_specialise_test_drop.pl\n" . |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
301 |
"Specify the name, build id and target device in an ATS XML test drop\n" . |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
302 |
"synopsis:\n" . |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
303 |
" ats_specialise_test_drop.pl --help\n" . |
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
304 |
" ats_specialise_test_drop.pl [--test-drop-name=TESTNAME] [--build-id=BUILDID] [--host-name=HOSTNAME] [--dest=FILE] --src=FILE [--publish=DIR] [--bld-drive=DRIVE] [--test-target=TARGET] [--image-path=PATH] [--ats-version=VERSION]\n" . |
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
305 |
"options:\n" . |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
306 |
" --help Display this help and exit\n" . |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
307 |
" --test-drop-name=TESTNAME TESTNAME is the desired name of the test drop. If not specified then the test drop name is not modified.\n" . |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
308 |
" --build-id=BUILDID BUILDID is id of the build being tested. If not specified then the build id is not modified.\n" . |
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
309 |
" --host-name=HOSTNAME HOSTNAME is the name of the ATS worker on which the test should be run. " . |
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
310 |
"If not specified then the test device name is not modified.\n" . |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
311 |
" --src=INFILE INFILE is the file containing the test drop XML to be modified, or else a zip file " . |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
312 |
" containing the test drop XML in the file 'test.xml'. INFILE must have extension .xml or.zip\n" . |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
313 |
" --dest=OUTFILE The modified output will be written to the file OUTFILE.EXT " . |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
314 |
"where EXT is same extention, .xml or .zip, found on INFILE. " . |
1085
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
315 |
"If OUTFILE is not specified then INFILE is modified\n" . |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
316 |
" --publish=DIR DIR is the publishing folder for ats reports (optional).\n" . |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
317 |
" --bld-drive=DRIVE DRIVE is the subst'd drive on which the build is stored (optional).\n" . |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
318 |
" --test-target=TARGET TARGET is the target which the tests will be run on. If not specified WINSCW will be set by default\n" . |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
319 |
" --image-path=PATH PATH is the path to the ROM image used for testing (not valid for WINSCW target).\n" . |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
320 |
" --ats-version=VERSION VERSION is the version of ATS which will be used to run the tests. If not specified ATS3 will be set by default.\n"; |
461755d25d57
Modified ats_specialise_test_drop to handle ats4 test plans
Maciej Seroka <maciejs@symbian.org>
parents:
1028
diff
changeset
|
321 |
|
134
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
322 |
exit $error; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
323 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
324 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
325 |
sub help() |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
326 |
{ |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
327 |
usage(0); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
328 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
329 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
330 |
sub usage_error() |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
331 |
{ |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
332 |
usage(1); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
333 |
} |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
334 |
|
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
335 |
sub silent_command($) |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
336 |
{ |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
337 |
my $cmd = shift; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
338 |
system("$cmd 1> $dev_null 2>&1"); |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
339 |
return $? >> 8; |
039d0b7e56f3
Comments and code tidying for ats3_testdrop.pl
Mike Kinghan <mikek@symbian.org>
parents:
diff
changeset
|
340 |
} |