36 |
</p> |
</p> |
37 |
|
|
38 |
<pre> |
<pre> |
39 |
tar jxvf jscoverage-0.1.tar.bz2 |
tar jxvf jscoverage-0.3.1.tar.bz2 |
40 |
cd jscoverage-0.1 |
cd jscoverage-0.3.1/ |
41 |
./configure |
./configure |
42 |
make |
make |
43 |
</pre> |
</pre> |
141 |
entering its URL into the "URL" input field. For example, to load |
entering its URL into the "URL" input field. For example, to load |
142 |
the file <code><var>DESTINATION-DIRECTORY</var>/dir/index.html</code>, you can |
the file <code><var>DESTINATION-DIRECTORY</var>/dir/index.html</code>, you can |
143 |
enter the relative URL <code>dir/index.html</code> into the input field. |
enter the relative URL <code>dir/index.html</code> into the input field. |
144 |
|
You can load any page located in <code><var>DESTINATION-DIRECTORY</var>/</code> |
145 |
|
or a subdirectory underneath <code><var>DESTINATION-DIRECTORY</var>/</code>; loading a page |
146 |
|
from outside <code><var>DESTINATION-DIRECTORY</var>/</code>, or from a foreign web |
147 |
|
server, will give unexpected results. |
148 |
</p> |
</p> |
149 |
|
|
150 |
<h3>3. Generating the coverage report</h3> |
<h3>3. Generating the coverage report</h3> |
226 |
<img src="screenshot4.png" alt="Screenshot"> |
<img src="screenshot4.png" alt="Screenshot"> |
227 |
|
|
228 |
<p> |
<p> |
229 |
From the "Summary" tab, you can click the links to get a detailed view of a JavaScript source file. |
You can click the checkbox to show a list of statements missed during execution. |
230 |
</p> |
</p> |
231 |
|
|
232 |
<img src="screenshot5.png" alt="Screenshot"> |
<img src="screenshot5.png" alt="Screenshot"> |
233 |
|
|
234 |
|
<p> |
235 |
|
You can click one of the links to get a detailed view of a JavaScript source file. |
236 |
|
</p> |
237 |
|
|
238 |
|
<img src="screenshot6.png" alt="Screenshot"> |
239 |
|
|
240 |
<h2>Inverted mode</h2> |
<h2>Inverted mode</h2> |
241 |
|
|
242 |
<p> |
<p> |
243 |
In some circumstances it may be difficult to execute your code within the |
In some situations it may be difficult to execute your code within the |
244 |
JSCoverage "Browser" tab. For example, the code may assume that it is running in |
JSCoverage "Browser" tab. For example, the code may assume that it is running in |
245 |
the top-level browser window, generating errors if it is executed from within a |
the top-level browser window, generating errors if it is executed from within a |
246 |
frame. JSCoverage has an alternative mode of operation, called <dfn>inverted |
frame. JSCoverage has an alternative mode of operation, called <dfn>inverted |
247 |
mode</dfn>, which may be useful in this situation. |
mode</dfn>, which may be useful in this case. |
248 |
</p> |
</p> |
249 |
|
|
250 |
<p> |
<p> |
275 |
</pre> |
</pre> |
276 |
|
|
277 |
<p> |
<p> |
278 |
|
Note that you <em>must</em> use a <code>window.open</code> call; simply making a |
279 |
|
link to <code>jscoverage.html</code> is not sufficient. |
280 |
|
</p> |
281 |
|
|
282 |
|
<p> |
283 |
An example is located in the <code>doc/example-inverted</code> directory. |
An example is located in the <code>doc/example-inverted</code> directory. |
284 |
You can instrument the code and launch the <code>index.html</code> page: |
You can instrument the code and launch the <code>index.html</code> page: |
285 |
</p> |
</p> |
314 |
</pre> |
</pre> |
315 |
copies <var>SOURCE-DIRECTORY</var> to <var>DESTINATION-DIRECTORY</var> |
copies <var>SOURCE-DIRECTORY</var> to <var>DESTINATION-DIRECTORY</var> |
316 |
recursively, but does not copy <var>SOURCE-DIRECTORY</var>/<var>PATH</var>. |
recursively, but does not copy <var>SOURCE-DIRECTORY</var>/<var>PATH</var>. |
317 |
<var>PATH</var> must be a complete path relative to <var>SOURCE-DIRECTORY</var> |
<var>PATH</var> must be a complete path relative to <var>SOURCE-DIRECTORY</var>. |
318 |
<var>PATH</var> can be a file or a directory (in which case the directory and |
<var>PATH</var> can be a file or a directory (in which case the directory and |
319 |
its entire contents are skipped). This option may be given multiple times. |
its entire contents are skipped). This option may be given multiple times. |
320 |
<dt><code>--no-instrument=<var>PATH</var></code> |
<dt><code>--no-instrument=<var>PATH</var></code> |
321 |
<dd>The command |
<dd>The command |
322 |
<pre> |
<pre> |
323 |
jscoverage --exclude=<var>PATH</var> <var>SOURCE-DIRECTORY</var> <var>DESTINATION-DIRECTORY</var> |
jscoverage --no-instrument=<var>PATH</var> <var>SOURCE-DIRECTORY</var> <var>DESTINATION-DIRECTORY</var> |
324 |
</pre> |
</pre> |
325 |
copies <var>SOURCE-DIRECTORY</var> to <var>DESTINATION-DIRECTORY</var> |
copies <var>SOURCE-DIRECTORY</var> to <var>DESTINATION-DIRECTORY</var> |
326 |
recursively, but does not instrument any JavaScript code in |
recursively, but does not instrument any JavaScript code in |
327 |
<var>SOURCE-DIRECTORY</var>/<var>PATH</var>. <var>PATH</var> must be a complete |
<var>SOURCE-DIRECTORY</var>/<var>PATH</var>. <var>PATH</var> must be a complete |
328 |
path relative to <var>SOURCE-DIRECTORY</var> <var>PATH</var> can be a |
path relative to <var>SOURCE-DIRECTORY</var>. <var>PATH</var> can be a |
329 |
(JavaScript) file or a directory (in which case any JavaScript files located |
(JavaScript) file or a directory (in which case any JavaScript files located |
330 |
anywhere underneath the directory are not instrumented). This option may be |
anywhere underneath the directory are not instrumented). This option may be |
331 |
given multiple times. |
given multiple times. |
348 |
<dt><code>m=<var>BOOLEAN</var></code>, <code>missing=<var>BOOLEAN</var></code> |
<dt><code>m=<var>BOOLEAN</var></code>, <code>missing=<var>BOOLEAN</var></code> |
349 |
<dd>Determines whether to initially display the "Missing" column in the "Summary" |
<dd>Determines whether to initially display the "Missing" column in the "Summary" |
350 |
tab. <var>BOOLEAN</var> can be |
tab. <var>BOOLEAN</var> can be |
351 |
<code>true</code>, <code>t</code>, <code>yes</code>, <code>y</code> <code>on</code>, <code>1</code> |
<code>true</code>, <code>t</code>, <code>yes</code>, <code>y</code>, <code>on</code>, <code>1</code> |
352 |
(to display the "Missing" column), or |
(to display the "Missing" column), or |
353 |
<code>false</code>, <code>f</code>, <code>no</code>, <code>n</code>, <code>off</code>, <code>0</code> |
<code>false</code>, <code>f</code>, <code>no</code>, <code>n</code>, <code>off</code>, <code>0</code> |
354 |
(to hide the "Missing" column) |
(to hide the "Missing" column). By default, the "Missing" column is not displayed. |
|
(By default, the "Missing" column is not displayed.) |
|
355 |
</dl> |
</dl> |
356 |
|
|
357 |
<h2>Caveats</h2> |
<h2>Caveats</h2> |
373 |
|
|
374 |
<address> |
<address> |
375 |
Copyright © 2007 siliconforks.com<br> |
Copyright © 2007 siliconforks.com<br> |
376 |
Last updated July 8, 2007<br> |
Last updated August 26, 2007<br> |
377 |
<a href="mailto:jscoverage@siliconforks.com">jscoverage@siliconforks.com</a> |
<a href="mailto:jscoverage@siliconforks.com">jscoverage@siliconforks.com</a> |
378 |
</address> |
</address> |
379 |
|
|