source: trunk/source/examples/code-cover-test/README.txt @ 15178

Last change on this file since 15178 was 15178, checked in by kmcorbett, 9 years ago

example: code coverage test with Hunchentoot handler to view results

File size: 2.1 KB
Line 
1;; -*- Mode:Text; tab-width:2; indent-tabs-mode:nil -*-
2
3code-cover-test - CCL code coverage test example
4
5To load use QuickLisp and/or ASDF, for example:
6
7   (ql:quickload :code-cover-test)
8
9COMPILE A CL SYSTEM WITH CODE COVERAGE
10
111. Load the code coverage test system
12
13   (ql:quickload "code-cover-test")
14   (in-package :code-cover-test)
15
162. Define CL systems to test. Ideally the system has a unit test driver.
17
18   Default is CL-PPCRE-TEST.
19
20   TODO: parameterize this - currently the CL-PPCRE systems are hard-coded.
21
22     * Define methods to specify systems and forms
23     * Remove CL-PPCRE dependency from package CODE-COVER-TEST
24
253. Compile and run tests with code coverage
26
27   (run-all-tests-with-code-coverage :compile-p t)
28
29   To (re)compile and (re)initialize code coverage only (not run tests)
30
31   (init-code-coverage :compile-p t)
32
33GENERATE REPORT ON CODE COVERAGE
34
351. Specify output directory - default is ~/tmp/code-cover-test
36
37   (setq *output-directory-path* #P"~/tmp/code-cover-test/")
38
392. Generate code coverage report output files
40
41   (report-code-coverage-test)
42
43VIEW CODE COVERAGE REPORTS
44
45Install the code coverage results into a Web server and view the generated page
46"index.html".  With some Web browsers, viewing the files using FILE URLs
47(without getting from on a Web server) will not serve the results in frames and
48Javascript UI won't work properly.
49
50Following are instructions to view code coverage results via Hunchentoot.
51
521. Load the code coverage test server
53
54   (ql:quickload "code-cover-test")
55   (in-package :code-cover-test)
56
572. Set the host and port as needed. These default to "localhost" and 9090, respectively.
58
59   (setq *server-port* 9090. *server-host* "localhost")
60
613. Start the server       
62
63   (start-code-coverage-test-server)
64
65   TODO: Make it easy to load code coverage server in a separate image to avoid
66   skewing results. (?)
67
684. View results in Web browser with appropriate URL. For example:
69
70   http://localhost:9090/code-cover-test
71
725. To stop the server:
73
74   (stop-code-coverage-test-server)
75
76   Restart as needed:
77
78   (start-code-coverage-test-server)
Note: See TracBrowser for help on using the repository browser.