1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
llvm-mirror/test/tools/llvm-cov/Inputs/regionMarkers.json
Vedant Kumar e22de321ce Retry: [llvm-cov] Add support for exporting coverage data to JSON
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
2016-07-26 22:50:58 +00:00

38 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":"{{[^"]+}}showRegionMarkers.cpp",
// 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":21,"covered":17,"percent":80,"noncode":0},
// CHECK-SAME: "functions":{"count":1,"covered":1,"percent":100},
// CHECK-SAME: "regions":{"count":10,"covered":7,"notcovered":3,"percent":70}}
// Close Files Array
// CHECK-SAME: ],
// Functions List
// CHECK-SAME: "functions":[
// CHECK-SAME: {"name":"main","count":1111000,"regions":[
// CHECK-SAME: {{(\[[0-9]+,[0-9]+,[0-9]+,[0-9]+,[0-9]+,[0-9]+,[0-9]+,[0-9]+\],?)+}}
// CHECK-SAME: ],
// CHECK-SAME: "filenames":["{{[^"]+}}showRegionMarkers.cpp"]
// CHECK-SAME: }],
// Full Export Summary
// CHECK-SAME: "totals":{
// CHECK-SAME: "lines":{"count":21,"covered":17,"percent":80,"noncode":0},
// CHECK-SAME: "functions":{"count":1,"covered":1,"percent":100},
// CHECK-SAME: "regions":{"count":10,"covered":7,"notcovered":3,"percent":70}}
// Close the export object, data array, and root object
// CHECK-SAME: }]}