webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
Public Member Functions | |
TestDriver (String[] args) | |
void | run () |
void | start () |
void | stop () |
void | closeLogs () |
void | writeLogHeaders (File output) |
Vector | getSuites (String[] files) |
void | getCases (TestSuite suite) |
synchronized void | executeSuite (TestSuite suite) |
void | writeTinderboxHeader (String executable) |
void | writeTinderboxSuiteName (TestSuite suite) |
void | writeTinderboxSuiteResult (TestSuite suite) |
String | getSuffix () |
void | setSuffix (String s) |
boolean | sleep (int ms) |
boolean | processOptions () |
Static Public Member Functions | |
static String [] | getSystemInformation () |
static TestLog | getLog (File output, String filename) |
static void | openLogFiles (File output) |
static String | stripDoubleSlashes (String string) |
static void | enablePrivileges () |
static void | writeSuiteResult (TestSuite suite, File output) |
static void | writeSuiteSummary (TestSuite suite, File output) |
static void | writeFileResult (TestFile file, TestSuite suite, File output) |
static String | readFile (String filePath) |
static void | writeCaseResults (TestFile file, TestSuite suite, File output) |
static void | writeCaseResults (TestFile file, String classname, File output) |
static void | writeDateToLogs (String separator, File output) |
static void | p (String s) |
static void | debug (String s) |
static String | getCurrentDate (String separator) |
static String | getCurrentTime () |
static void | main (String[] args) |
Static Public Attributes | |
static boolean | TINDERBOX = false |
static final boolean | DEBUG = true |
static final boolean | TCMS = false |
static final String | SUMMARY_LOG_NAME = "summ.html" |
static final String | CASE_LOG_NAME = "case.html" |
static final String | FILE_LOG_NAME = "file.html" |
static final String | SUITE_LOG_NAME = "suite.html" |
static final String | DEBUG_LOG_NAME = "debug.html" |
static final String | TERMINATOR = "<BR>\n" |
Parent class for JavaScript test drivers. Subclasses run tests against the JavaScript engine in C, Java, and its embedding in Navigator.
The default implementation does nothing, but contains methods that are used by all subclasses.
The JavaScript test suite is extendable. To write a new JavaScript test, your test program must call a function that returns array of TestCase objects. The TestCase object is defined in shell.js:
function TestCase( n, d, e, a ) { this.name = n; this.description = d; this.expect = e; this.actual = a; this.passed = true; this.reason = ""; this.passed = getTestCaseResult( this.expect, this.actual ); }
In your test program you should:
To add new test to the suite:
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
If the environment uses a Security Manager and requires privileges to access system properties, override this method to enable privileges. The default method does nothing.
|
inline |
Subclasses should override this method to iterate through all TestFiles in the TestSuite, create a new TestEnvironment, run the test, and close the TestEnvironment.
For examples,
For each test file in the suite directory, create a TestFile object.
|
inlinestatic |
From the current Date, return a string in the format "DD?MM?YY", where "/" is specified by the separator argument.
|
inlinestatic |
From the current time, return a string in the format "HH:MM:SS"
|
inlinestatic |
|
inline |
|
inline |
For each subdirectory of the main test directory, create a new TestSuite object.
|
inlinestatic |
Get information about the operating system.
|
inlinestatic |
Create and write headers to log files.
output | directory in which output files are written. |
|
inlinestatic |
Convenience methods.
|
inline |
Implementations need to override this method, which should call its own constructor, passing the args object as an argument. Process options should parse the ARGS object.
return true if the driver should continue. return false if the driver should not continue.
|
inlinestatic |
Read the contents of a file into a string.
|
inline |
|
inline |
|
inline |
Temporary stop this thread for 5 seconds.
|
inline |
|
inline |
Close all logs.
|
inlinestatic |
If two slashes in a row are found, one slash is stripped out. Mac client has trouble if we don't do this. xxx this doesn't work and needs to be fixed.
|
inlinestatic |
Test Case Management System (TCMS) requires the following information: (MachineID), -pass- or FAIL, TestFileName/Beaker, TestFileName,Date Run in MM/DD/YY, Start Time HH:MM:SS, End Time HH:MM:SS, ExpectedResults String (quite often null), Actual Result String, Reason For Failure
Tests can provide this information. we expected it to be in an object called "TestCase" with the following structure:
function TestCase( passed, name, expect, actual, reason ) { this.passed = passed; this.name = "Description of the Test Case"; this.expect = ( theExpectedResult ); this.actual = ( theActualResult ); this.reason = ( reasonForFailure ); }
we will generate machineID, pass/fail, date run, start time, end time.
If TCMS == false, omit unnecessary log id.
|
inlinestatic |
Short version of writing test case results to the CASE_LOG, used by LiveConnecTest subclasses.
cases | vector of testcases whose results should be written to the CASE_LOG. LiveConnectTest sends a vector of failed TestCase objects. |
classname | name of the LiveConnectTest class |
output | directory in which output is written. |
|
inlinestatic |
Write system information and current date to the SUMMARY_LOG, FILE_LOG, and SUITE_LOG.
XXX need to fix this to output all test information.
|
inlinestatic |
Write the result of the current file to the FILE_LOG. If the file threw an exception, print the exception.
|
inlinestatic |
Write an HTML-formatted string to SUITE_LOG.
|
inlinestatic |
Write an HTML-formatted string to the SUMMARY_LOG that looks like this:
Suite Number of Number of Passed Failed Result Name Files Cases # % # %
|
inline |
Write the suite result to the Tinderbox log.
XXX need machine, branch, startTime, endTime
|
inline |
|
inline |
|
static |
|
static |
|
static |
|
static |
|
static |