Skip to main content

Drill4Net Scanner Parameters

Example#

Drill4Net.Scanner.exe <path that contains executable file> --target <path to executable file> --exclude "[myapplication.*]MyApplication.Core.Coverage"

Drill4Net allows to explicitly set what must be included using the --include option.

Examples

--include "[*]*" - Includes all types in all assemblies (everything is instrumented)
--include "[myapplication.*]MyApplication.Core.Coverage" - Includes the Coverage class in the MyApplication.Core namespace belonging to any assembly that matches "myapplication.*" (e.g "myapplication.core")
--include "[myapplication.*.tests?]*" - Includes all types in any assembly starting with "myapplication." and ending with ".test" or ".tests" (the ? makes the "s" optional)

Both --exclude and --include options can be used together but --exclude takes precedence. You can specify the --exclude and --include options multiple times to allow for multiple filter expressions. You can also include coverage of the test assembly itself by specifying the --include-test-assembly flag.

Optional Parameters#

There are some optional parameters to which you can provide arguments in Drill4Net Scanner

--exclude Filter expressions to exclude specific modules and types.
--include Filter expressions to include only specific modules and types.
--exclude-by-file Glob patterns specifying source files to exclude.
--include-directory Include directories containing additional assemblies to be instrumented.
--exclude-by-attribute Attributes to exclude from code coverage.
--include-test-assembly Specifies whether to report code coverage of the test assembly.

NB. For multiple value options, you have to specify values multiple times i.e.

--exclude-by-attribute 'Obsolete' --exclude-by-attribute'GeneratedCode' --exclude-by-attribute 'CompilerGenerated'

Filters#

Dill4Net gives the ability to have fine-grained control over what gets excluded using filter expressions. Syntax: --exclude '[Assembly-Filter]Type-Filter' Wildcards

  • * - matches zero or more characters
  • ? - the prefixed character is optional

Examples

--exclude "[*]*" - Excludes all types in all assemblies (nothing is instrumented)
--exclude "[myapplication.*]MyApplication.Core.Coverage" - Excludes the Coverage class in the MyApplication.Core namespace belonging to any assembly that matches "myapplication.*" (e.g "myapplication.core")
--exclude "[*]MyApplication.Core.Instrumentation.*" - Excludes all types belonging to MyApplication.Core.Instrumentation namespace in any assembly
--exclude "[myapplication.*.tests?]*" - Excludes all types in any assembly starting with "myapplication." and ending with ".test" or ".tests" (the ? makes the "s" optional)
--exclude "[myapplication.*]*" --exclude "[*]MyApplication.Core*" - Excludes assemblies matching "myapplication.*" and excludes all types belonging to the MyApplication.Core namespace in any assembly
--exclude "[myapplication.core]MyApplication.Core.Coverage" - Excludes the Coverage class in the MyApplication.Core namespace belonging to "myapplication.core" assembly