PageRenderTime 40ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/external/webkit/Source/JavaScriptCore/tests/mozilla/README-jsDriver.html

https://gitlab.com/brian0218/rk3188_r-box_android4.2.2_sdk
HTML | 344 lines | 335 code | 8 blank | 1 comment | 0 complexity | f3c25c3bd6a87a347247f06e0859f257 MD5 | raw file
  1. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
  2. <html>
  3. <head>
  4. <title>jsDriver.pl</title>
  5. </head>
  6. <body bgcolor="white">
  7. <h1 align="right">jsDriver.pl</h1>
  8. <dl>
  9. <dt><b>NAME</b></dt>
  10. <dd>
  11. <b>jsDriver.pl</b> - execute JavaScript programs in various shells in
  12. batch or single mode, reporting on failures encountered.
  13. <br>
  14. <br>
  15. <dt><b>SYNOPSIS</b></dt>
  16. <dd>
  17. <table>
  18. <tr>
  19. <td align="right" valign="top">
  20. <code>
  21. <b>jsDriver.pl</b>
  22. </code>
  23. </td>
  24. <td>
  25. <code>
  26. [-hkt] [-b BUGURL] [-c CLASSPATH] [-f OUTFILE]
  27. [-j JAVAPATH] [-l TESTLIST ...] [-L NEGLIST ...] [-p TESTPATH]
  28. [-s SHELLPATH] [-u LXRURL] [--help] [--confail] [--trace]
  29. [--classpath=CLASSPATH] [--file=OUTFILE] [--javapath=JAVAPATH]
  30. [--list=TESTLIST] [--neglist=TESTLIST] [--testpath=TESTPATH]
  31. [--shellpath=SHELLPATH] [--lxrurl=LXRURL] {-e ENGINETYPE |
  32. --engine=ENGINETYPE}
  33. </code>
  34. </td>
  35. </tr>
  36. </table>
  37. <br>
  38. <br>
  39. <dt><b>DESCRIPTION</b></dt>
  40. <dd>
  41. <b>jsDriver.pl</b> is normally used to run a series of tests against
  42. one of the JavaScript shells. These tests are expected to be laid out
  43. in a directory structure exactly three levels deep. The first level
  44. is considered the <b>root</b> of the tests, subdirectories under the
  45. <b>root</b> represent <b>Test Suites</b> and generally mark broad
  46. categories such as <i>ECMA Level 1</i> or <i>Live Connect 3</i>. Under the
  47. <b>Test Suites</b> are the <b>Test Categories</b>, which divide the
  48. <b>Test Suite</b> into smaller categories, such as <i>Execution Contexts</i>
  49. or <i>Lexical Rules</i>. Testcases are located under the
  50. <B>Test Categories</b> as normal JavaScript (*.js) files.
  51. <p>
  52. If a file named <b>shell.js</b> exists in either the
  53. <b>Test Suite</b> or the <b>Test Category</b> directory, it is
  54. loaded into the shell before the testcase. If <b>shell.js</b>
  55. exists in both directories, the version in the <b>Test Suite</b>
  56. directory is loaded <i>first</i>, giving the version associated with
  57. the <b>Test Category</b> the ability to override functions previously
  58. declared. You can use this to
  59. create functions and variables common to an entire suite or category.
  60. <p>
  61. Testcases can report failures back to <b>jsDriver.pl</b> in one of
  62. two ways. The most common is to write a line of text containing
  63. the word <code>FAILED!</code> to <b>STDOUT</b> or <b>STDERR</b>.
  64. When the engine encounters a matching line, the test is marked as
  65. failed, and any line containing <code>FAILED!</code> is displayed in
  66. the failure report. The second way a test case can report failure is
  67. to return an unexpected exit code. By default, <b>jsDriver.pl</b>
  68. expects all test cases to return exit code 0, although a test
  69. can output a line containing <code>EXPECT EXIT <i>n</i></code> where
  70. <i>n</i> is the exit code the driver should expect to see. Testcases
  71. can return a nonzero exit code by calling the shell function
  72. <code>quit(<i>n</i>)</code> where <code><i>n</i></code> is the
  73. code to exit with. The various JavaScript shells report
  74. non-zero exit codes under the following conditions:
  75. <center>
  76. <table border="1">
  77. <tr>
  78. <th>Reason</th>
  79. <th>Exit Code</th>
  80. </tr>
  81. <tr>
  82. <td>
  83. Engine initialization failure.
  84. </td>
  85. <td>
  86. 1
  87. </td>
  88. </tr>
  89. <tr>
  90. <td>
  91. Invalid argument on command line.
  92. </td>
  93. <td>
  94. 2
  95. </td>
  96. </tr>
  97. <tr>
  98. <td>
  99. Runtime error (uncaught exception) encountered.
  100. </td>
  101. <td>
  102. 3
  103. </td>
  104. </tr>
  105. <tr>
  106. <td>
  107. File argument specified on command line not found.
  108. </td>
  109. <td>
  110. 4
  111. </td>
  112. </tr>
  113. <tr>
  114. <td>
  115. Reserved for future use.
  116. </td>
  117. <td>
  118. 5-9
  119. </td>
  120. </tr>
  121. </table>
  122. </center>
  123. <br>
  124. <br>
  125. <dt><b>OPTIONS</b></dt>
  126. <dd>
  127. <dl>
  128. <dt><b>-b URL, --bugurl=URL</b></dt>
  129. <dd>
  130. Bugzilla URL. When a testcase writes a line in the format
  131. <code>BUGNUMBER <i>n</i></code> to <b>STDOUT</b> or <b>STDERR</b>,
  132. <b>jsDriver.pl</b> interprets <code><i>n</i></code> as a bugnumber
  133. in the <a href="http://bugzilla.mozilla.org">BugZilla</a> bug
  134. tracking system. In the event that a testcase which has specified
  135. a bugnumber fails, a hyperlink to the BugZilla database
  136. will be included in the output by prefixing the bugnumber with the
  137. URL specified here. By default, URL is assumed to be
  138. &quot;http://bugzilla.mozilla.org/show_bug.cgi?id=&quot;.
  139. <br>
  140. <br>
  141. <a name="classpath"></a>
  142. <dt><b>-c PATH, --classpath=PATH</b></dt>
  143. <dd>
  144. Classpath to pass the the Java Virtual Machine. When running tests
  145. against the <b>Rhino</b> engine, PATH will be passed in as the value
  146. to an argument named &quot;-classpath&quot;. If your particular JVM
  147. does not support this option, it is recommended you specify your
  148. class path via an environment setting. Refer to your JVM
  149. documentation for more details about CLASSPATH.
  150. <br>
  151. <br>
  152. <dt><b>-e TYPE ..., --engine=TYPE ...</b></dt>
  153. <dd>
  154. Required. Type of engine(s) to run the tests against. TYPE can be
  155. one or more of the following values:
  156. <center>
  157. <table border="1">
  158. <tr>
  159. <th>TYPE</th>
  160. <th>Engine</th>
  161. </tr>
  162. <tr>
  163. <td>lcopt</td>
  164. <td>LiveConnect, optimized</td>
  165. </tr>
  166. <tr>
  167. <td>lcdebug</td>
  168. <td>LiveConnect, debug</td>
  169. </tr>
  170. <tr>
  171. <td>rhino</td>
  172. <td>Rhino compiled mode</td>
  173. </tr>
  174. <tr>
  175. <td>rhinoi</td>
  176. <td>Rhino interpreted mode</td>
  177. </tr>
  178. <tr>
  179. <td>rhinoms</td>
  180. <td>Rhino compiled mode for the Microsoft VM (jview)</td>
  181. </tr>
  182. <tr>
  183. <td>rhinomsi</td>
  184. <td>Rhino interpreted mode for the Microsoft VM (jview)</td>
  185. </tr>
  186. <tr>
  187. <td>smopt</td>
  188. <td>Spider-Monkey, optimized</td>
  189. </tr>
  190. <tr>
  191. <td>smdebug</td>
  192. <td>Spider-Monkey, debug</td>
  193. </tr>
  194. <tr>
  195. <td>xpcshell</td>
  196. <td>XPConnect shell</td>
  197. </tr>
  198. </table>
  199. </center>
  200. <br>
  201. <br>
  202. <dt><b>-f FILE, --file=FILE</b></dt>
  203. <dd>
  204. Generate html output to the HTML file named by FILE. By default,
  205. a filename will be generated using a combination of the engine type
  206. and a date/time stamp, in the format:
  207. <code>results-<i>&lt;engine-type&gt;</i>-<i>&lt;date-stamp&gt;</i>.html</code>
  208. <br>
  209. <br>
  210. <dt><b>-h, --help</b></dt>
  211. <dd>
  212. Prints usage information.
  213. <br>
  214. <br>
  215. <dt><b>-j PATH, --javapath=PATH</b></dt>
  216. <dd>
  217. Set the location of the Java Virtual Machine to use when running
  218. tests against the <b>Rhino</b> engine. This can be used to test
  219. against multiple JVMs on the same system.
  220. <br>
  221. <br>
  222. <dt><b>-k, --confail</b></dt>
  223. <dd>
  224. Log failures to the console. This will show any failures, as they
  225. occur, on <b>STDERR</b> in addition to creating the HTML results
  226. file. This can be useful for times when it may be
  227. counter-productive to load an HTML version of the results each time
  228. a test is re-run.
  229. <br>
  230. <br>
  231. <dt><b>-l FILE ..., --list=FILE ...</b></dt>
  232. <dd>
  233. Specify a list of tests to execute. FILE can be a plain text file
  234. containing a list of testcases to execute, a subdirectory
  235. in which to
  236. <a href="http://www.instantweb.com/~foldoc/foldoc.cgi?query=grovel">grovel</a>
  237. for tests, or a single testcase to execute. Any number of FILE
  238. specifiers may follow this option. The driver uses the fact that a
  239. valid testcase should be a file ending in .js to make the distinction
  240. between a file containing a list of tests and an actual testcase.
  241. <br>
  242. <br>
  243. <dt><b>-L FILE ..., --neglist=FILE ...</b></dt>
  244. <dd>
  245. Specify a list of tests to skip. FILE has the same meaning as in
  246. the <b>-l</b> option. This option is evaluated after
  247. <b>all</b> <b>-l</b> and <b>--list</b> options, allowing a user
  248. to subtract a single testcase, a directory of testcases, or a
  249. collection of unrelated testcases from the execution list.
  250. <br>
  251. <br>
  252. <dt><b>-p PATH, --testpath=PATH</b></dt>
  253. <dd>
  254. Directory holding the &quot;Test Suite&quot; subdirectories. By
  255. default this is ./
  256. <br>
  257. <br>
  258. <dt><b>-s PATH, --shellpath=PATH</b></dt>
  259. <dd>
  260. Directory holding the JavaScript shell. This can be used to override
  261. the automatic shell location <b>jsDriver.pl</b> performs based on
  262. you OS and engine type. For Non <b>Rhino</b> engines, this
  263. includes the name of the executable as well as the path. In
  264. <b>Rhino</b>, this path will be appended to your
  265. <a href="#classpath">CLASSPATH</a>. For the
  266. <b>SpiderMonkey</b> shells, this value defaults to
  267. ../src/&lt;Platform-and-buildtype-specific-directory&gt;/[js|jsshell],
  268. for the
  269. <b>LiveConnect</b> shells,
  270. ../src/liveconnect/src/&lt;Platform-and-buildtype-specific-directory&gt;/lschell
  271. and for the <b>xpcshell</b> the default is the value of your
  272. <code>MOZILLA_FIVE_HOME</code> environment variable. There is no
  273. default (as it is usually not needed) for the <b>Rhino</b> shell.
  274. <br>
  275. <br>
  276. <dt><b>-t, --trace</b></dt>
  277. <dd>
  278. Trace execution of <b>jsDriver.pl</b>. This option is primarily
  279. used for debugging of the script itself, but if you are interested in
  280. seeing the actual command being run, or generally like gobs of
  281. useless information, you may find it entertaining.
  282. <br>
  283. <br>
  284. <dt><b>-u URL, --lxrurl=URL</b></dt>
  285. <dd>
  286. Failures listed in the HTML results will be hyperlinked to the
  287. lxr source available online by prefixing the test path and
  288. name with this URL. By default, URL is
  289. http://lxr.mozilla.org/mozilla/source/js/tests/
  290. <br>
  291. <br>
  292. </dl>
  293. <dt><b>SEE ALSO</b></dt>
  294. <dd>
  295. <a href="http://lxr.mozilla.org/mozilla/source/js/tests/jsDriver.pl">jsDriver.pl</a>,
  296. <a href="http://lxr.mozilla.org/mozilla/source/js/tests/mklistpage.pl">mklistpage.pl</a>,
  297. <a href="http://www.mozilla.org/js/">http://www.mozilla.org/js/</a>,
  298. <a href="http://www.mozilla.org/js/tests/library.html">http://www.mozilla.org/js/tests/library.html</a>
  299. <br>
  300. <br>
  301. <dt><b>REQUIREMENTS</b></dt>
  302. <dd>
  303. <b>jsDriver.pl</b> requires the
  304. <a href="http://search.cpan.org/search?module=Getopt::Mixed">Getopt::Mixed</a>
  305. perl package, available from <a href="http://www.cpan.org">cpan.org</a>.
  306. <br>
  307. <br>
  308. <dt><b>EXAMPLES</b></dt>
  309. <dd>
  310. <code>perl jsDriver.pl -e smdebug -L lc*</code><br>
  311. Executes all tests EXCEPT the liveconnect tests against the
  312. SpiderMonkey debug shell, writing the results
  313. to the default result file. (NOTE: Unix shells take care of wildcard
  314. expansion, turning <code>lc*</code> into <code>lc2 lc3</code>. Under
  315. a DOS shell, you must explicitly list the directories.)
  316. <p>
  317. <code>perl jsDriver.pl -e rhino -L rhino-n.tests</code><br>
  318. Executes all tests EXCEPT those listed in the
  319. <code>rhino-n.tests</code> file.
  320. <p>
  321. <code>perl -I/home/rginda/perl/lib/ jsDriver.pl -e lcopt -l lc2
  322. lc3 -f lcresults.html -k</code><br>
  323. Executes ONLY the tests under the <code>lc2</code> and <code>lc3</code>
  324. directories against the LiveConnect shell. Results will be written to
  325. the file <code>lcresults.html</code> <b>AND</b> the console. The
  326. <code>-I</code> option tells perl to look for modules in the
  327. <code>/home/rginda/perl/lib</code> directory (in addition to the
  328. usual places), useful if you do not have root access to install new
  329. modules on the system.
  330. </dl>
  331. <hr>
  332. Author: Robert Ginda<br>
  333. Currently maintained by <i><a href="mailto:pschwartau@netscape.com">Phil Schwartau</a> </i><br>
  334. <!-- Created: Thu Dec 2 19:08:05 PST 1999 -->
  335. </body>
  336. </html>