##// END OF EJS Templates
run_tests.pl: do not return error code when there are failed tests
Jani Honkonen -
r2079:7d9cfff99e14
parent child
Show More
@@ -23,7 +23,7 mkdir $reports_path;
23
23
24 # setup environment for running tests
24 # setup environment for running tests
25 given ($job{'Platform'}) {
25 given ($job{'Platform'}) {
26
26
27 when ("Win7") {
27 when ("Win7") {
28 # Add qtdir to path
28 # Add qtdir to path
29 $ENV{'PATH'} .= ";" . $job{'QtDir'} . "\\bin";
29 $ENV{'PATH'} .= ";" . $job{'QtDir'} . "\\bin";
@@ -44,7 +44,7 given ($job{'Platform'}) {
44 # Set QML_IMPORT_PATH point to QML plugin dir
44 # Set QML_IMPORT_PATH point to QML plugin dir
45 $ENV{'QML_IMPORT_PATH'} = $bin_path;
45 $ENV{'QML_IMPORT_PATH'} = $bin_path;
46 }
46 }
47 }
47 }
48
48
49 # Go through all the files in the test folder
49 # Go through all the files in the test folder
50 # autotest is an executable beginning with "tst_"
50 # autotest is an executable beginning with "tst_"
@@ -55,9 +55,9 while ($testapp = readdir TESTAPPDIR) {
55 if (index($testapp, "tst_") == 0) {
55 if (index($testapp, "tst_") == 0) {
56 if (-x "$bin_path$testapp") {
56 if (-x "$bin_path$testapp") {
57 my $status = executeTestApp($testapp);
57 my $status = executeTestApp($testapp);
58 if ($status != 0) {
58 if ($status != 0) {
59 $script_exit_status = $status;
59 $script_exit_status = $status;
60 }
60 }
61 } else {
61 } else {
62 #print "file $testapp not executable\n";
62 #print "file $testapp not executable\n";
63 }
63 }
@@ -65,31 +65,31 while ($testapp = readdir TESTAPPDIR) {
65 }
65 }
66 closedir TESTAPPDIR;
66 closedir TESTAPPDIR;
67
67
68 print "\n*** script exit status : $script_exit_status ***\n\n";
68 # Do not return error codes for bamboo.
69 exit($script_exit_status);
69 # Bamboo will determine test failures by parsing the xml logs.
70 exit(0);
70
71
71
72
72 sub executeTestApp($) {
73 sub executeTestApp($) {
73 my $testapp = $_[0];
74 my $testapp = $_[0];
74
75
75 # On OSX the actual test binary is in a sub folder
76 # On OSX the actual test binary is in a sub folder
76 my $cmd_postfix = "";
77 my $cmd_postfix = "";
77 if ($^O eq "darwin") {
78 if ($^O eq "darwin") {
78 $cmd_postfix = "/Contents/MacOS/$testapp";
79 $cmd_postfix = "/Contents/MacOS/$testapp";
79 $cmd_postfix = substr($cmd_postfix, 0, rindex($cmd_postfix, ".app"));
80 $cmd_postfix = substr($cmd_postfix, 0, rindex($cmd_postfix, ".app"));
80 }
81 }
81
82
82 my $cmd = "$bin_path$testapp$cmd_postfix -xunitxml -o $reports_path/$testapp.xml";
83 my $cmd = "$bin_path$testapp$cmd_postfix -xunitxml -o $reports_path/$testapp.xml";
83 print "executing: $cmd\n";
84 print "executing: $cmd\n";
84 system($cmd);
85 system($cmd);
85
86
86 # From http://perldoc.perl.org/perlvar.html about $?:
87 # From http://perldoc.perl.org/perlvar.html about $?:
87 # The upper eight bits reflect specific error conditions encountered by the
88 # The upper eight bits reflect specific error conditions encountered by the
88 # program (the program's exit() value). The lower eight bits reflect
89 # program (the program's exit() value). The lower eight bits reflect
89 # mode of failure, like signal death and core dump information.
90 # mode of failure, like signal death and core dump information.
90 # See wait(2) for details.
91 # See wait(2) for details.
91 my $exit_status = $? >> 8;
92 my $exit_status = $? >> 8;
92 print "\texit status: $exit_status\n";
93 print "\texit status: $exit_status\n";
93
94 return $exit_status;
94 return $exit_status;
95 }
95 }
General Comments 0
You need to be logged in to leave comments. Login now