/[jscoverage]/trunk/doc/manual.html
ViewVC logotype

Diff of /trunk/doc/manual.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 498 by siliconforks, Sun Dec 27 18:53:34 2009 UTC revision 502 by siliconforks, Mon Dec 28 04:21:14 2009 UTC
# Line 509  Line 509 
509  <dd>Use the specified JavaScript version; valid values for <var>VERSION</var>  <dd>Use the specified JavaScript version; valid values for <var>VERSION</var>
510  are <code>1.0</code>, <code>1.1</code>, <code>1.2</code>, ..., <code>1.8</code>,  are <code>1.0</code>, <code>1.1</code>, <code>1.2</code>, ..., <code>1.8</code>,
511  or <code>ECMAv3</code> (the default).  or <code>ECMAv3</code> (the default).
512    <dt><code>--mozilla</code>
513    <dd>Specify that the source directory contains an application based on the Mozilla platform (see <a href="#mozilla">below</a>).
514  <dt><code>--no-highlight</code>  <dt><code>--no-highlight</code>
515  <dd>Do not perform syntax highlighting of JavaScript code.  <dd>Do not perform syntax highlighting of JavaScript code.
516  <dt><code>--no-instrument=<var>URL</var></code>  <dt><code>--no-instrument=<var>URL</var></code>
# Line 700  Line 702 
702  Currently, <code>//#JSCOVERAGE_IF</code> comments are not recorded in stored coverage reports.  Currently, <code>//#JSCOVERAGE_IF</code> comments are not recorded in stored coverage reports.
703  </p>  </p>
704    
705    <h3 id="mozilla">Code coverage for Mozilla platform applications</h3>
706    
707    <p>
708    JSCoverage can be used to generate code coverage data for applications based on
709    the Mozilla platform.
710    </p>
711    
712    <div class="warning">
713      <h4>Warning</h4>
714      The functionality described here is highly experimental.  It may change in future versions.
715    </div>
716    
717    <p>
718    A simple example program is included in the <code>doc/example-mozilla/</code>
719    directory.
720    You can instrument and run this program as follows:
721    </p>
722    
723    <pre>
724    jscoverage --mozilla --no-instrument=defaults doc/example-mozilla doc/example-mozilla-instrumented
725    xulrunner doc/example-mozilla-instrumented/application.ini -console
726    </pre>
727    
728    <p>
729    Note that the <code>--mozilla</code> option is used to specify that the program
730    is based on the Mozilla platform.
731    Also, the code in the <code>defaults/</code> directory is skipped because the
732    <code>.js</code> files in this directory are preferences files (and are
733    different from ordinary JavaScript files).
734    XULRunner is used to run the instrumented application:
735    </p>
736    
737    <p>
738    <img src="mozilla-before-click.png" alt="Screenshot">
739    </p>
740    
741    <p>
742    The JavaScript code in the application is executed by selecting a radio button:
743    </p>
744    
745    <p>
746    <img src="mozilla-after-click.png" alt="Screenshot">
747    </p>
748    
749    <p>
750    When the application is exited, a coverage report is stored in a subdirectory of
751    the application's directory named <code>jscoverage-report/</code>.
752    You can view the report in a web browser by opening the
753    <code>jscoverage.html</code> file in this directory (i.e.,
754    <code>doc/example-mozilla-instrumented/jscoverage-report/jscoverage.html</code>).
755    </p>
756    
757  <h2>Caveats</h2>  <h2>Caveats</h2>
758    
759  <ul>  <ul>

Legend:
Removed from v.498  
changed lines
  Added in v.502

  ViewVC Help
Powered by ViewVC 1.1.24