forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 2
/
QATest.pm
54 lines (41 loc) · 2.2 KB
/
QATest.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Client-side JavaScript, DOM Core/HTML/Views, and Form Submission tests.
# Currently only available inside netscape firewall.
sub QATest {
my ($test_name, $build_dir, $binary_dir, $args) = @_;
my $binary_log = "$build_dir/$test_name.log";
my $url = "http://geckoqa.mcom.com/ngdriver/cgi-bin/ngdriver.cgi?findsuites=suites&tbox=1";
# Settle OS.
system('/bin/sh -c "sync; sleep 5"');
my $rv;
$rv = AliveTest("QATest_raw", $build_dir,
[@$args, $url],
$Settings::QATestTimeout);
# XXXX testing. -mcafee
$rv = 'success';
# Post-process log of test output.
my $mode = "express";
open QATEST, "perl $build_dir/../qatest.pl $build_dir/QATest_raw.log $mode |"
or die "Unable to run qatest.pl";
my $qatest_html = "";
while (<QATEST>) {
chomp;
#$_ =~ s/\"/"/g; #### it doesn't like this line
# $_ =~ s/\012//g;
### $_ =~ s/\s+\S/ /g; # compress whitespace.
$qatest_html .= $_;
}
close QATEST;
Util::print_log("\n");
# This works.
#$qatest_html = "<table border=2 cellspacing=0><tr%20valign=top><td> </td><td>Passed</td><td>Failed</td><td>Total</td><td>Died</td><td>% Passed</td><td>% Failed</td></tr><tr%20valign=top><td>DHTML</a></td><td>9</td><td>0</td><td>9</td><td>0</td><td>100</td><td>0</td></tr><tr%20valign=top><td>DOM VIEWS</a></td><td>2</td><td>0</td><td>2</td><td>0</td><td>100</td><td>0</td></tr><tr%20valign=top><td>Total:</td><td>11</td><td>0</td><td>11</td><td>0</td><td>100</td><td>0</td></tr></table>";
# Testing output
open TEST_OUTPUT, ">qatest_out.log";
print TEST_OUTPUT $qatest_html;
close TEST_OUTPUT;
Util::print_log("TinderboxPrint:<a href=\"javascript:var newwin;newwin=window.open("","","menubar=no,resizable=yes,height=150,width=500");var newdoc=newwin.document;newdoc.write('$qatest_html');newdoc.close();\">QA</a>\n");
return $rv; # Hard-coded for now.
}
1;