profiles
<profiles>
Since 3.1.11. Optional element. Defines a list of Clover profiles, which can be selected at runtime by providing a clover.profile=<name> system property. Thanks to this you can change some of Clover's behavior without code recompilation.
<profiles>
<profile name="default" coverageRecorder="FIXED|GROWABLE|SHARED">
<distributedCoverage/> <!-- optional -->
</profile>
<profile .../>
<!-- more profiles -->
</profile>
<profile>
Since 3.1.11. Contains a definition of a single runtime profile.
Parameters
Attribute | Description | Required |
---|---|---|
name | The name for this profile; name must be unique among profiles. There must be one profile named "default". | No. Defaults to "default". |
coverageRecorder | Type of coverage recorder which will be used for gathering coverage data at runtime. Possible values: FIXED, GROWABLE, SHARED (case insensitive). Warning: we strongly recommend using the default setting. Do not change until you deeply understand how it works. | No. Defaults to "FIXED". |
Nested elements
<distributedCoverage/>
Note: a definition in <profile>/<distributedCoverage> element has priority over the <clover-setup|clover-instr>/<distributedCoverage> element.
Selecting clover.profile at runtime
Clover profile is being selected at runtime using the following algorithm:
- Are there any profiles defined in compiled code?
- yes -
- 1. read the clover.profile system property. is it defined?
- yes - use the value as profile name
- no - use the "default" profile name
- 2. is the profile name found on list of defined profiles?
- yes - use settings from this profile
- no - use system settings (default coverage recorder etc...)
- 1. read the clover.profile system property. is it defined?
- no - use system settings (default coverage recorder etc...)
- yes -
So it fall-backs to default system settings in case of missing profile.