regression_tests.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
  2. <!-- This Source Code Form is subject to the terms of the Mozilla Public
  3. - License, v. 2.0. If a copy of the MPL was not distributed with this
  4. - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  8. <title>Layout Regression tests</title>
  9. <style type="text/css">
  10. body {font-family:arial}
  11. .screen {background-color:silver; color:blue}
  12. pre.screen {display:table-cell}
  13. </style>
  14. </head>
  15. <body>
  16. <h1>Table Regression Tests</h1>
  17. <h6>Bernd Mielke</h6>
  18. <h2>About This Document</h2>
  19. <p>
  20. This document describes my guerrilla approach to successfully running the table layout regression tests. It should encourage more people to run those tests.
  21. <h2>Subject Overview</h2>
  22. <p>
  23. The table element and its children are one of the major layout components that can create some structure on the screen. They are widely (ab)used by page authors. Every small change in the table code can generate a bunch of bugzilla entries and a lot of seemingly unrelated dupes. With the high frequency of checkins in to the source tree it is difficult and time consuming to track the regression down to a single checkin. The risk of becoming very infamous can be reduced by running the layout regression tests.
  24. <h2>Prerequisites</h2>
  25. <p>
  26. In order to run these tests, you will need to have:
  27. <ol>
  28. <li>a debug build with a working viewer, an optimized build will not work!
  29. <li>a mozilla tree with the testfiles at <code>%MOZ_SRC%/layout/html/tests</code>,
  30. <li> <code>DISABLE_TESTS</code> should not be defined,
  31. <li>patience and time.
  32. </ol>
  33. <h2>Test Runs</h2>
  34. <ul>
  35. <li>Go to the <code>%MOZ_SRC%/layout/html/tests/block</code> directory.
  36. <li> Avoid the nasty assertions to pop up by <code>set XPCOM_DEBUG_BREAK=warn</code>, the world would be a much better place if we could <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=152015">first fix those assertions</a>.
  37. <li>The following shell scripts need a <code>sh</code> before the command under WinXX.
  38. <li>Execute <code>rtest.sh baseline</code>
  39. <li>Execute <code>rtest.sh verify&gt;outputfile.txt</code>
  40. <li>Make a note which tests have failed (these are false positives. If you are in bad mood file a bug against Chris Waterson about them)
  41. <li>you can grep the failures by:<br>
  42. <code>grep 'rgd failed' &lt;outputfile.txt &gt;false_positive.txt</code>
  43. <li> Make a copy of <code>gklayout.dll</code> and <code>gkcontent.dll</code> in the <code>dist</code> directory. If you would like to switch back, you will need them.
  44. <li>Make your changes to the source, compile and install.
  45. <li>execute in the <code>layout/html/tests/block</code> directory <code>rtest.sh verify &gt;regression.txt</code>
  46. <li>Check how many tests have failed and analyse your results:
  47. <ul>
  48. <li>If the regression tests have failed at the same place as the previous diagnosed false positives =&gt; ignore
  49. <ol>
  50. <li>copy <code>rtest.sh</code> to <code>my_rtest.sh</code>
  51. <li>create a new directory <code>my_files</code>.
  52. <li>create in this directory a file <code>file_list.txt</code>, where you put the url's of your remaining test failures
  53. <li>change <code>my_rtest.sh</code> to use only directory <code>my_files</code>
  54. <li>go back to the original gklayout.dll and gkcontent.dll and repeat the regression test procedure on a much smaller set now.
  55. </ol>
  56. <li>Try to figure out what the other regressions are: Are they
  57. improving the picture or are they regressions?
  58. <li>Note the difficult to explain testfailures.
  59. </ul>
  60. <li> Change the source if necessary until the regression tests indicate that your patch does not hork the block and table layout
  61. <li> Submit your patch and lists the remaining differences in the bug
  62. </ul>
  63. <p>Be prepared to cycle.
  64. <h2>How the layout regression tests work</h2>
  65. <p>First the URL's to test are red from <code>file_list.txt</code>.<p>
  66. <table><caption>snippet from file_list.txt</caption><tr><td>
  67. <pre>file:///s|/mozilla/layout/html/tests/table/dom/appendCells1.html
  68. file:///s|/mozilla/layout/html/tests/table/dom/appendCellsRebuild1.html
  69. file:///s|/mozilla/layout/html/tests/table/dom/appendCol1.html
  70. file:///s|/mozilla/layout/html/tests/table/dom/appendCol2.html
  71. file:///s|/mozilla/layout/html/tests/table/dom/appendColGroup1.html
  72. file:///s|/mozilla/layout/html/tests/table/dom/appendRowsExpand1.html</pre>
  73. </td></tr></table>
  74. <p>The regression tests compare the frame tree dumps recorded at two different times. The URL's to test are red from <code>file_list.txt</code>
  75. For every file in <code>file_list.txt</code>viewer takes the root frame and dumps the whole tree via
  76. <a href="http://lxr.mozilla.org/seamonkey/search?string=nsFrame%3A%3ADumpRegression">
  77. nsFrame::DumpRegression</a>.
  78. <p>
  79. The frame tree dumps are invoked by the <code>-o</code> switch to the <code>viewer</code> (see <a href="http://lxr.mozilla.org/seamonkey/ident?i=PrintHelpInfo">commandline arguments </a>).
  80. When <code>-o</code> is specified together with a output directory for instance (<code>-o s:\mozilla\layout\html\tests\table\dom\</code>),
  81. the frame trees are dumped to separate files in that directory for all URL's in <code>file_list.txt</code> (see:
  82. <a href="http://lxr.mozilla.org/seamonkey/search?string=nsWebCrawler%3A%3ADumpRegression">
  83. nsWebCrawler::DumpRegressionData</a>) .
  84. <p>Their name is generated by replacing the old extension <code>.html</code> or <code>.xml</code> with <code>.rgd</code>. For <code>file:///s|/mozilla/layout/html/tests/table/dom/appendCells1.html</code> a file <code>appendCells1.rgd</code> will be created in the <code>s:\mozilla\layout\html\tests\table\dom\</code> directory.
  85. <p>
  86. There is a special type of frame dumps - the printing regression tests, they are invoked by the <code>-Prt</code> command line argument to the <code>viewer</code> and include first a display then a frame dump taking into account the printer pages. A typical beginning of a dump (<code>*.rgd</code> file) looks like:<p>
  87. <pre class="screen">
  88. &lt;frame va="15022440" type="Viewport(-1)" state="270340" parent="0"&gt;
  89. &lt;view va="47171904"&gt;
  90. &lt;/view&gt;
  91. &lt;stylecontext va="15022232"&gt;
  92. &lt;font serif 240 240 0 /&gt;
  93. &lt;color data="-16777216"/&gt;
  94. &lt;background data="0 2 3 -1 0 0 "/&gt;
  95. &lt;spacing data="left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0" /&gt;
  96. &lt;list data="100 100 " /&gt;
  97. &lt;position data="left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 0 Auto " /&gt;
  98. &lt;text data="0 0 0 Normal Normal 0[0x0]tw Normal " /&gt;
  99. &lt;textreset data="0 10[0xa]enum " /&gt;
  100. &lt;display data="0 1 0 0 0 0 0 0 0 0 0 0 " /&gt;
  101. &lt;visibility data="0 1 1.000000" /&gt;
  102. &lt;table data="0 0 4 -1 1 " /&gt;
  103. &lt;tableborder data="1 Null Null 0 2 " /&gt;
  104. &lt;content data="0 0 0 Null " /&gt;
  105. &lt;quotes data="0 " /&gt;
  106. &lt;ui data="3 0 0 1 " /&gt;
  107. &lt;uireset data="7 0 4" /&gt;
  108. &lt;xul data="0 0 0 0 0 1 &lt;svg data="0 1.000000 1.000000 0 1.000000" /&gt;
  109. &lt;/stylecontext&gt;</pre>
  110. <p>The first run of the regression tests is started with the argument <code>baseline</code> and it creates the reference frame dumps.
  111. <p>The <code>baseline</code> log will look like:
  112. <pre class="screen">
  113. Type Manifest File: C:\MOZ_SOUR\MOZILLA\MOZILLA\DIST\WIN32_D.OBJ\BIN\components\xpti.dat
  114. nsNativeComponentLoader: autoregistering begins.
  115. nsNativeComponentLoader: autoregistering succeeded
  116. Going to create the event queue
  117. WEBSHELL+ = 1
  118. Note: verifyreflow is disabled
  119. Note: styleverifytree is disabled
  120. Note: frameverifytree is disabled
  121. +++ file:///s|/mozilla/layout/html/tests/table/dom/appendCells1.html: done loading (11810 msec)
  122. appendCells1.rgd - being written
  123. +++ file:///s|/mozilla/layout/html/tests/table/dom/appendCellsRebuild1.html: done loading (1260 msec)
  124. appendCellsRebuild1.rgd - being written
  125. +++ file:///s|/mozilla/layout/html/tests/table/dom/appendCol1.html: done loading (270 msec)
  126. appendCol1.rgd - being written
  127. +++ file:///s|/mozilla/layout/html/tests/table/dom/appendCol2.html: done loading (220 msec)
  128. appendCol2.rgd - being written
  129. +++ file:///s|/mozilla/layout/html/tests/table/dom/appendColGroup1.html: done loading (390 msec)
  130. appendColGroup1.rgd - being written
  131. +++ file:///s|/mozilla/layout/html/tests/table/dom/appendRowsExpand1.html: done loading (220 msec)
  132. appendRowsExpand1.rgd - being written
  133. </pre>
  134. <p>
  135. The second run with the argument <code>verify</code> creates first the frame dumps in a subdirectory (<code>verify</code>) and <a href="http://lxr.mozilla.org/seamonkey/search?string=nsFrameUtil%3A%3ACompareTrees">compares</a> each frame dump with the corresponding reference frame dump. If they differ in critical points the test fails.
  136. <p>A typical part of the <code>verify</code> log would look like:
  137. <pre class="screen">
  138. Type Manifest File: C:\MOZ_SOUR\MOZILLA\MOZILLA\DIST\WIN32_D.OBJ\BIN\components\xpti.dat
  139. nsNativeComponentLoader: autoregistering begins.
  140. nsNativeComponentLoader: autoregistering succeeded
  141. Going to create the event queue
  142. WEBSHELL+ = 1
  143. Note: verifyreflow is disabled
  144. Note: styleverifytree is disabled
  145. Note: frameverifytree is disabled
  146. +++ file:///s|/mozilla/layout/html/tests/table/dom/appendCells1.html: done loading (2200 msec)
  147. frame bbox mismatch: 0,285,930,435 vs. 0,285,1305,435
  148. Node 1:
  149. TableOuter(table)(1) 0x10004 0,285,930,435, |null attr|-16777216|left: 0[0x0]tw top: 0[0x0]tw right: 0[0x0]tw bottom: 0[0x0]tw left: 0[0x0]tw top: 0[0x0]tw right: 0[0x0]tw bottom: 0[0x0]tw left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Inherit top: Inherit right: Inherit bottom: Inherit 0[0x0]tw 0[0x0]tw Null 0[0x0]tw 0[0x0]tw Null 0 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 8 0 0 0 0 0 1 0 0 0 0 |0 0 4 -1 1 |0 0 0 Null
  150. Node 2:
  151. TableOuter(table)(1) 0x10004 0,285,1305,435, |null attr|-16777216|left: 0[0x0]tw top: 0[0x0]tw right: 0[0x0]tw bottom: 0[0x0]tw left: 0[0x0]tw top: 0[0x0]tw right: 0[0x0]tw bottom: 0[0x0]tw left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Inherit top: Inherit right: Inherit bottom: Inherit 0[0x0]tw 0[0x0]tw Null 0[0x0]tw 0[0x0]tw Null 0 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 8 0 0 0 0 0 1 0 0 0 0 |0 0 4 -1 1 |0 0 0 Null
  152. frame bbox mismatch: 0,0,930,435 vs. 0,0,1305,435
  153. Node 1:
  154. Table(table)(1) 0x10004 0,0,930,435, |null attr|-16777216|left: Null top: 0[0x0]tw right: Null bottom: 0[0x0]tw left: Null top: Null right: Null bottom: Null left: 15[0xf]tw top: 15[0xf]tw right: 15[0xf]tw bottom: 15[0xf]tw left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 2 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 8 0 0 0 0 0 0 0 0 0 0 |0 8 4 -1 1 |0 0 0 Null
  155. Node 2:
  156. Table(table)(1) 0x10004 0,0,1305,435, |null attr|-16777216|left: Null top: 0[0x0]tw right: Null bottom: 0[0x0]tw left: Null top: Null right: Null bottom: Null left: 15[0xf]tw top: 15[0xf]tw right: 15[0xf]tw bottom: 15[0xf]tw left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 2 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 8 0 0 0 0 0 0 0 0 0 0 |0 8 4 -1 1 |0 0 0 Null
  157. frame bbox mismatch: 45,15,840,405 vs. 45,15,1215,405
  158. Node 1:
  159. TableColGroup(table)(1) 0x80010004 45,15,840,405, |null attr|-16777216|left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 0 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 12 0 0 0 0 0 0 0 0 0 0 |0 0 4 -1 1 |0 0 0 Null
  160. Node 2:
  161. TableColGroup(table)(1) 0x80010004 45,15,1215,405, |null attr|-16777216|left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 0 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 12 0 0 0 0 0 0 0 0 0 0 |0 0 4 -1 1 |0 0 0 Null
  162. frame state mismatch: 0x30010406 vs. 0x30010004
  163. Node 1:
  164. TableCol(table)(1) 0x30010406 0,0,0,0, |null attr|-16777216|left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 0 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 11 0 0 0 0 0 0 0 0 0 0 |0 0 4 -1 1 |0 0 0 Null
  165. Node 2:
  166. TableCol(table)(1) 0x30010004 870,0,345,405, |null attr|-16777216|left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 0 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 11 0 0 0 0 0 0 0 0 0 0 |0 0 4 -1 1 |0 0 0 Null
  167. frame bbox mismatch: 0,0,0,0 vs. 870,0,345,405
  168. Node 1:
  169. TableCol(table)(1) 0x30010406 0,0,0,0, |null attr|-16777216|left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 0 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 11 0 0 0 0 0 0 0 0 0 0 |0 0 4 -1 1 |0 0 0 Null
  170. Node 2:
  171. TableCol(table)(1) 0x30010004 870,0,345,405, |null attr|-16777216|left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 0 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 11 0 0 0 0 0 0 0 0 0 0 |0 0 4 -1 1 |0 0 0 Null
  172. regression test s:\mozilla\layout\html\tests\table\dom\verify\appendCells1.rgd failed
  173. +++ file:///s|/mozilla/layout/html/tests/table/dom/appendCellsRebuild1.html: done loading (390 msec)
  174. 044regression test s:\mozilla\layout\html\tests\table\dom\verify\appendCellsRebuild1.rgd passed
  175. +++ file:///s|/mozilla/layout/html/tests/table/dom/appendCol1.html: done loading (280 msec)
  176. regression test s:\mozilla\layout\html\tests\table\dom\verify\appendCol1.rgd passed
  177. +++ file:///s|/mozilla/layout/html/tests/table/dom/appendCol2.html: done loading (220 msec)
  178. regression test s:\mozilla\layout\html\tests\table\dom\verify\appendCol2.rgd passed
  179. +++ file:///s|/mozilla/layout/html/tests/table/dom/appendColGroup1.html: done loading (220 msec)
  180. regression test s:\mozilla\layout\html\tests\table\dom\verify\appendColGroup1.rgd passed
  181. </pre>
  182. <p>
  183. The first regression test has failed and it is marked so.
  184. <h2>Adding new regression tests</h2>
  185. <p>
  186. Once you have checked in the code:
  187. <ul>
  188. <li> please add your testcase for the bug to the regression tests.
  189. <li>A testcase should only contain local files.
  190. <li>Place the images in <code>table/images</code> (don't forget <code> cvs commit -kb </code>)
  191. <li>and the testfile in the <code>table/bugs</code> directory.
  192. <li>Update the <code>file_list<b>x</b>.txt</code> in order to include your file.
  193. </ul>
  194. <p>I would like to thank Chris Karnaze for his guidance and fantasai for his language support.
  195. <div style="text-align:right"><i>&lt;regression.html&gt;&nbsp; &lt;Last updated:
  196. 2002-06-16 <a href="mailto:bernd.mielke@snafu.de">Bernd Mielke</a></i></div>
  197. </body>
  198. </html>