mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-22 20:43:44 +02:00
e22de321ce
This enables users to export coverage information as portable JSON for use by analysis tools and storage in document based databases. The export sub-command is invoked just like the others: llvm-cov export -instr-profile path/to/foo.profdata path/to/foo.binary The resulting JSON contains a list of files and functions. Every file object contains a list of segments, expansions, and a summary of the file's region, function, and line coverage. Every function object contains the function's name and regions. There is also a total summary for the entire object file. Changes since the initial commit (r276813): - Fixed the regexes in the tests to handle Windows filepaths. Patch by Eddie Hurtig! Differential Revision: https://reviews.llvm.org/D22651 llvm-svn: 276818
37 lines
1.3 KiB
JSON
37 lines
1.3 KiB
JSON
// Metadata section
|
|
// CHECK: {"version":"1.0.0","type":"llvm.coverage.json.export","data":[
|
|
|
|
// Open Export
|
|
// CHECK-SAME: {"object":"{{[^"]+}}","files":[
|
|
|
|
// File Object
|
|
// CHECK-SAME: {"filename":"{{[^"]+}}universal-binary.c",
|
|
// CHECK-SAME: "segments":[
|
|
// CHECK-SAME: {{(\[[0-9]+,[0-9]+,[0-9]+,[0-9]+,[0-9]+\],?)+}}],
|
|
// CHECK-SAME: "expansions":[],
|
|
|
|
// Verify the Summary Section for the first file
|
|
// CHECK-SAME: "summary":{
|
|
// CHECK-SAME: "lines":{"count":1,"covered":1,"percent":100,"noncode":0},
|
|
// CHECK-SAME: "functions":{"count":1,"covered":1,"percent":100},
|
|
// CHECK-SAME: "regions":{"count":1,"covered":1,"notcovered":0,"percent":100}}
|
|
|
|
// Close Files Array
|
|
// CHECK-SAME: ],
|
|
|
|
// Functions List
|
|
// CHECK-SAME: "functions":[
|
|
// CHECK-SAME: {"name":"main","count":100,"regions":[
|
|
// CHECK-SAME: {{(\[[0-9]+,[0-9]+,[0-9]+,[0-9]+,[0-9]+,[0-9]+,[0-9]+,[0-9]+\],?)+}}],
|
|
// CHECK-SAME: "filenames":["{{[^"]+}}universal-binary.c"]
|
|
// CHECK-SAME: }],
|
|
|
|
// Full Export Summary
|
|
// CHECK-SAME: "totals":{
|
|
// CHECK-SAME: "lines":{"count":1,"covered":1,"percent":100,"noncode":0},
|
|
// CHECK-SAME: "functions":{"count":1,"covered":1,"percent":100},
|
|
// CHECK-SAME: "regions":{"count":1,"covered":1,"notcovered":0,"percent":100}
|
|
|
|
// Close the export object, data array, and root object
|
|
// CHECK-SAME: }]}
|