From 02f4700f65df11c5ed286c716e9351daf547e853 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 28 Nov 2010 15:30:29 +0000 Subject: document how to run the unit tests --- docs/index.html | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/docs/index.html b/docs/index.html index 1d57d49..b5ea14a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -10,6 +10,7 @@
  • Browser Compatibility
  • API documentation
  • Release process and tools
  • +
  • Running automated tests
  • Browser Compatibility

    Jarmon depends upon the Flot @@ -46,7 +47,7 @@

    This is the default IE compatibility workaround. Jarmon bundles the excanvas library which translates canvas api calls into VML, but this is much slower - than the native canvas support in other browsers. In the absense of + than the native canvas support in other browsers. In the absence of other workarounds, Jarmon will transparently use the excanvas library.
    Chrome Frame @@ -92,3 +93,39 @@ out the source code, then issue the ./bin/build -V 10.8 release command from within the source tree.

    + +

    Running automated tests

    +

    Jarmon includes unit tests which are used to exercise the library + code, to check for compatibility with various platforms and web client + software and to check for regressions as the library evolves.

    +

    The unit tests are designed to be run inside a web browser using the + YUI test harness.

    +
      +
    1. Generate test data by running the following command + ./bin/build testdata from within the source tree. +
    2. Start a web server to serve the test page. Eg + $ nginx -p . -c docs/examples/nginx.conf.example
    3. +
    4. Use a web browser to load + the test page + ( + http://localhost:8080/test.html)
    5. +
    +

    Measure code coverage

    +

    There are number of tools available to measure the + code coverage of + Javascript unit tests.

    +

    One such tool is + JSCoverage. It is very easy to install JSCoverage on a Debian / Ubuntu + system and use it to measure the coverage of the Jarmon unit tests.

    +
      +
    1. sudo aptitude install jscoverage - install + jscoverage.
    2. +
    3. jscoverage-server - run the JSCoverage web server from + the root of the Jarmon source tree.
    4. +
    5. Visit + http://localhost:8080/jscoverage.html?test.html to run the unit + tests through the JSCoverage server. The server will automatically + + instrument the Jarmon code and present a web interface which reports + how much of the code has been exercised.
    6. +
    -- cgit v1.1-4-g5e80