Below is my piece of perl code. I made it always exit gracefully.
Line numbers are also included here. Could you please tell me which line(s)
would cause a test result failure?
Thanks.
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use File::Path;
6 use File::Copy;
7 use FindBin '$Bin';
8
9 my $org_rslt = "$Bin/TEST-results.xml.org"; *# a predefined static xml
file*
10 my $rslt = "$Bin/TEST-results.xml";
11 rmtree($rslt) if(-e $rslt);
12
13 if(-e $org_rslt) {
14 if(!copy($org_rslt, $rslt)) { *# To create a fresh xml file*
15 print "Failed to copy '$org_rslt' to '$rslt'!\n";
16 }
17 }
18 else {
19 print "===--->>>The original result file '$org_rslt' does not
exist!!\n";
20 }
21
22 if(-e $rslt) {
23 print "The NEW result file '$rslt' exists!\n";
24 }
25 else {
26 print "===--->>>The NEW result file '$rslt' does not exists!\n";
27 }
28 exit 0; *# always exit gracefully no matter what*
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.