Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.

Commit

Permalink
Adding HTML example
Browse files Browse the repository at this point in the history
  • Loading branch information
whart222 committed Jul 4, 2013
1 parent 40393ad commit 90c8c33
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ outputs:

clean:
- \rm -f guide.xml
- \rm -f examples/.*.py examples/.*.h examples/.*.cpp examples/.*.sh examples/runner examples/TEST*.xml examples/parsetab.py examples/*.orig examples/runner.cpp
- \rm -f examples/.*.py examples/.*.h examples/.*.cpp examples/.*.sh examples/runner examples/TEST*.xml examples/parsetab.py examples/*.orig examples/runner.cpp examples/*.html
Binary file added doc/examples/example1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions doc/examples/example4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

. GetGlobals.sh
export PATH=$CXXTEST/bin:$PATH:`pwd`/../../scripts

cd example1
ROOT=`pwd`

# @compile:
g++ -fprofile-arcs -ftest-coverage -fPIC -O0 example1.cpp -o program
# @:compile

# @run:
./program
# @:run

# @gcovr:
gcovr -r . --html -o example1.html
# @:gcovr
mv example1.html ..

\rm -f program *.gc*
17 changes: 16 additions & 1 deletion doc/guide.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ statistics when deciding if software is ready for a release.
The +gcovr+ command can be used to analyze programs compiled with
GCC. The following sections illustrate the application of +gcovr+
to test coverage of the following program:
[source,cpp,numbered]
----
include::examples/example1/example1.cpp[]
----
Expand Down Expand Up @@ -186,6 +186,21 @@ used to support performance optimization in the same manner that
+gcov+ does.
HTML Output
~~~~~~~~~~~
The +gcovr+ command can also generate a simple
HTML output using the +--html+ option:
[source,bash]
----
include::examples/.example4_gcovr.sh[]
----
This generates a HTML summary of the lines executed. In this example, the file +example1.html+ is generated, which has the following output:
image::examples/example1.png[align="center"]
[[gcovrCommand]]
The +gcovr+ Command
-----------------
Expand Down

0 comments on commit 90c8c33

Please sign in to comment.