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