blob: 6040a9ee7414ea4f1542036835f1c4357c195c30 [file] [log] [blame]
<?php
$title = "Regression Testing";
include("../header.inc");
?>
<h2>Regression Testing</h2>
<h3>The WebKit Tests</h3>
<p>Before patches can land in any of the frameworks in the repository, the layout regression tests must be run. To run these tests, execute the <tt>run-webkit-tests</tt> script.</p>
<p class="code">WebKitTools/Scripts/run-webkit-tests</p>
<p>It's handy to put the <tt>WebKitTools/Scripts</tt> directory in your shell path so you can type commands like <tt>run-webkit-tests</tt> without specifying the path to the script.</p>
<p>The script will dump the render trees for all of the pages and diff the results against the expected correct results. If no
differences are found, then the patch has passed the tests. If any tests fail, then the patch cannot be committed until the
discrepancies in the tests are resolved.</p>
<p>Regression tests must be run on Leopard, since the expected results checked in were generated on Leopard.</p>
<h3>The JavaScriptCore Tests</h3>
<p>If you are making changes to JavaScriptCore, there is an additional test suite you must run before landing changes.
This is the Mozilla JavaScript test suite.</p>
<h3>What's covered by the JavaScript tests?</h3>
<p>The JavaScript tests cover the functionality of the core JavaScript engine.
This includes the following JavaScript objects:
<table>
<tr>
<td valign="top">
<ul>
<li>Arrays</li>
<li>Booleans</li>
<li>Dates</li>
<li>Functions</li>
</ul>
</td>
<td valign="top">
<ul>
<li>Global Object</li>
<li>Math</li>
<li>Numbers</li>
<li>Objects</li>
</ul>
</td>
<td valign="top">
<ul>
<li>Regular Expressions</li>
<li>Strings</li>
</ul>
</td>
</tr>
</table>
In addition, the JavaScript tests cover parsing, lexical conventions,
expressions, statements, type conversion, and exception handling.
<h3>How to run the tests</h3>
<p>Execute the "run-javascriptcore-tests" script:</p>
<p class="code">WebKitTools/Scripts/run-javascriptcore-tests</p>
<p>The script will run all the tests and summarize how the results differ from what is currently expected.</p>
<h3>What just happened</h3>
<p>
After all the test runs have finished the results of tests are saved to <tt>actual.html</tt>.
The script the compares these results from your local tree against what is expected to pass/fail from the tip of tree.
If there are any regressions caused by your changes you'll be made aware of them.
If you fixed a bug that caused an existing failure, you'll also be made aware of what specific test your fix affected.
</p>
<h3>What to do next</h3>
<p>So you fixed a bug that fixed a test. This means you've now set a new baseline for the tree as a result.</p>
<p class="code">cp actual.html expected.html</p>
<p>When you land your changes, the baseline (expected.html) will be updated in the tree.</p>
<h3>What happens if I caused a regression?</h3>
<p>It's not the end of the world. Go back and fix your bug and re-run <tt>run-javascriptcore-tests</tt> as many times as necessary.</p>
<?php
include("../footer.inc");
?>