1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
// Policy used in Coverity tests.
//
// Generates UNCALLED defects for functions which are not called by any test.
// Generates INSUFFICIENT_COVERAGE defects for functions which do not have
// 100% line coverage.
// Generates INSUFFICIENT_FILE_COVERAGE defects for files which do not
// have 100% line coverage.
//
// The line immediately following a coverity[TA.COVERAGE] annotation
// (i.e. in source code comments) is ignored for coverage purposes.
// Lines with xnocover annotations are ignored for coverage purposes.
{
type: "Coverity test policy definition",
format_version: 1,
recent_date_cutoff: "2012-03-07", // 6.1.0
old_date_cutoff: "2010-12-14", // 6.0.0
rules: [
{
violation_name: "INSUFFICIENT_COVERAGE",
aggregation_granularity: "function",
minimum_line_coverage_pct: 100,
use_filters: [ "exclude_annotated_lines", "executed_code", "focus_on_my_source", "exclude_logging_code", "exclude_throw_statements", "exclude_error_handlers" ]
},
],
define_filters: [
{
filter_name: "executed_code",
function_filters: [
{ is_executed: true,
exclusion_reason: "unexecuted code",
}
]
},
{
filter_name: "exclude_annotated_lines",
line_filters: [
{ not: { or: [
{ line_regex: "coverity\\[TA\\.COVERAGE\\]", line_offset: -1 },
{ line_regex: "xnocover" },
] },
exclusion_reason: "coverage annotation",
}
]
},
{
filter_name: "exclude_logging_code",
line_filters: [
{ not: { or: [
{ line_regex: "ACE_DEBUG" },
{ line_regex: "ACE_ERROR" },
{ line_regex: "ACE_ERROR_RETURN" },
{ line_regex: "ACELIB_DEBUG" },
{ line_regex: "ACELIB_ERROR" },
{ line_regex: "ACELIB_ERROR_RETURN" },
{ line_regex: "TAOLIB_DEBUG" },
{ line_regex: "TAOLIB_ERROR" },
{ line_regex: "TAOLIB_ERROR_RETURN" },
{ line_regex: "TAO_debug_level" },
{ line_regex: "ORBSVCS_DEBUG" },
{ line_regex: "ORBSVCS_ERROR" },
{ line_regex: "ORBSVCS_ERROR_RETURN" },
{ line_regex: "VDBG" },
{ line_regex: "VDBG_LVL" },
{ line_regex: "Transport_debug_level" },
{ line_regex: "_tao_print_exception" },
] },
exclusion_reason: "policy indicates no need to test logging code",
}
]
},
{
filter_name: "exclude_throw_statements",
line_filters: [
{ exclusion_reason: "on throw path",
not: {
contains_astnode: {
dominated_by_astnode: {
expression_kind: "throw" ,
}
}
}
}
]
},
{
filter_name: "exclude_error_handlers",
line_filters: [
{ not: { line_regex: "return\\s+-1" },
exclusion_reason: "policy indicates no need to test error handlers",
}
]
},
{
filter_name: "focus_on_my_source",
file_filters: [
{
exclusion_reason: "outside interesting source locations",
and: [
{ or: [
{ file_name_regex: ".*/ACE/ace/.*" },
{ file_name_regex: ".*/DDS/dds/DCPS/.*" },
{ file_name_regex: ".*/TAO/tao/.*" },
{ file_name_regex: ".*/TAO/orbsvcs/orbsvcs/Naming/.*" },
{ file_name_regex: ".*/TAO/orbsvcs/orbsvcs/Notify/.*" },
{ file_name_regex: ".*/TAO/orbsvcs/orbsvcs/Event/.*" }
] }
]
}
]
},
]
}
|