You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature to select lines contained in [list of] SHAs/changelists.
See 'genhtml --select-script ...'
Add file name and line number to 'select' callback.
Clarify '--select-script' documentation.
Signed-off-by: Henry Cox <[email protected]>
Copy file name to clipboardExpand all lines: man/lcovrc.5
+48-6Lines changed: 48 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2312,6 +2312,21 @@ The resolve script is called as:
2312
2312
[callback_args]
2313
2313
.I"file_name"
2314
2314
.PP
2315
+
2316
+
or
2317
+
.IP
2318
+
.I$resolve_callback=
2319
+
.Bresolve_module
2320
+
.I->new([callback_args])
2321
+
.PP
2322
+
to initialize the callback, then
2323
+
.IP
2324
+
.I$resolve_callback->
2325
+
.Bresolve
2326
+
.I(file_name)
2327
+
.PP
2328
+
to find the actual file location.
2329
+
2315
2330
If necessary, the callback can check the suffix of the filename to determine
2316
2331
whether it should look for either a source or data file.
2317
2332
.PP
@@ -2337,29 +2352,56 @@ Lines which are not selected but fall within
2337
2352
.Inum_context_lines
2338
2353
of a selected line are also included in the report. See below.
2339
2354
2355
+
Note that selection is fundamentally intended to show regions of code with soem surrounding context. It might not do what you expect if there is no code - e.g., if the region of interest has been compiled out via compiler or exclusion directives.
2356
+
For example: when selecting based on SHA or changelist ID, an inserted comment will not be selected unless it is
2357
+
.Inum_context_lines
2358
+
of an inserted or changed line of code.
2359
+
2340
2360
The select script is called as:
2341
2361
2342
2362
.B"select_script"
2343
2363
[callback_args]
2344
-
.IlineDataJson[annotateDataJson]
2364
+
.IlineDataJsonannotateDataJsonfilenNamelineNumber
2345
2365
2346
2366
or as:
2347
2367
2348
-
.B"select_module"
2349
-
[callback_args]
2350
-
.IlineDataRef[annotateDataRef]
2368
+
.I"$selectCallback="
2369
+
.Bselect_module
2370
+
.I->new([callback_args])
2371
+
2372
+
to initialize the callback object, then as
2373
+
2374
+
.I""$selectCallback
2375
+
.Bselect
2376
+
.I(lineDataRefannotateDataReffileNamelineNumber)
2351
2377
2378
+
.RS
2379
+
to determine selection,
2352
2380
where
2381
+
.IP\-3
2382
+
.IfileName
2383
+
is the name of the source file and
2384
+
.PP
2385
+
.IP\-3
2386
+
.IlineNumber
2387
+
is the source file line number, indexed from zero,
2388
+
.PP
2389
+
.IP\-3
2353
2390
.IlineDataJson
2354
-
is a json-encoded LineData structure (see the lcovutil.pm source code) and
2355
-
.IannoateDataJson
2391
+
is a json-encoded LineData structure (see the lcovutil.pm source code), and
2392
+
.PP
2393
+
.IP\-3
2394
+
.IannotateDataJson
2356
2395
is the json-encoded data returned by your
2357
2396
.Iannotate\-script
2358
2397
(see the
2359
2398
.I\-\-annotate\-script
2360
2399
parameter in man
2361
2400
.Bgenhtml(1).
2401
+
), or the empty string if there are no annotations for this file.
2402
+
.PP
2362
2403
The module callback is similar except that is is passed objects rather than JSON encodings of the objects.
0 commit comments