BullseyeCoverage Up Contents Search

Regions

A region specifies an area of source code to include or exclude from processing. A region is one of the following:

areaAll source code inside the area
!areaAll source code outside the area

An area is made up of the following elements:

/A single forward slash specifies all sources files, including those on all local and network drives.
class-or-namespace::C++ class and namespace names are written with the suffix :: and specify all functions in the named class or namespace.
directory/Directories are written with a trailing slash / and specify all source files in the directory and all its sub-directories.
functionA function name, including parameters spelled exactly as shown by BullseyeCoverage.
sourceSource filenames either contain a dot . or end with the suffix :, and specify all the functions in the source.

You can concatenate the elements listed above to form more specific regions.

class-or-namespace::functionA function in a specific C++ class or namespace in any source file
directory/sourceAll functions in the specified source within the specified directory
source:class-or-namespace::All functions in a specific C++ class or namespace in a specific source file
source:class-or-namespace::functionA function in a specific C++ class or namespace in a specific source
source:functionA function in a specific source file

You can specify wildcards in filenames as described below.

*Match zero or more characters except for /. For example, a*z matches az, abz and abcz, but not a/z
**/Matches one or more directories. For example, **/a matches d1/a, d1/d2/a, d1/d2/d3/a
?Match any character except for /. For example, a?z matches abz but not az and not abcz
[set] Matches any character in the set except for /. A set is a list of characters or a range specified by a dash between two characters. Specify a dash first to include it in the set. For example, [abc0-9] matches a and 5 but not d
[!set] Matches any character not in the set except for /.
\Turns off the special meaning of the following character.
/On Windows, match the path directory separator \. For example, a/b matches a\b

Write double quotes around wildcards on the command line. Otherwise, the wildcards may match filenames in the file system, rather than inside the coverage file. For example, the command covbr p*.c first matches any files in the current directory beginning with p and ending with .c, then searches the coverage file for those specific filenames. In contrast, the command covbr "p*.c" searches the coverage file for filenames beginning with p and ending with .c and is unaffected by any filenames which may exist in the current directory.

If the first region specification in effect is an exclusion (!), then all source is initially included, otherwise all source is initially excluded. For example, consider the following two sequences.

!source1.cpp source2.cpp
source1.cpp !source2.cpp

The first sequence above specifies to include everything except source1.cpp. The second sequence specifies to include only source1.cpp. In both cases, the second region is redundant.

Updated: 27 Sep 2023