1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.devtools.resultstore.v2; 18 19import "google/devtools/resultstore/v2/common.proto"; 20 21option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore"; 22option java_multiple_files = true; 23option java_outer_classname = "CoverageSummaryProto"; 24option java_package = "com.google.devtools.resultstore.v2"; 25 26// Summary of line coverage 27message LineCoverageSummary { 28 // Number of lines instrumented for coverage. 29 int32 instrumented_line_count = 1; 30 31 // Number of instrumented lines that were executed by the test. 32 int32 executed_line_count = 2; 33} 34 35// Summary of branch coverage 36// A branch may be: 37// * not executed. Counted only in total. 38// * executed but not taken. Appears in total and executed. 39// * executed and taken. Appears in all three fields. 40message BranchCoverageSummary { 41 // The number of branches present in the file. 42 int32 total_branch_count = 1; 43 44 // The number of branches executed out of the total branches present. 45 // A branch is executed when its condition is evaluated. 46 // This is <= total_branch_count as not all branches are executed. 47 int32 executed_branch_count = 2; 48 49 // The number of branches taken out of the total branches executed. 50 // A branch is taken when its condition is satisfied. 51 // This is <= executed_branch_count as not all executed branches are taken. 52 int32 taken_branch_count = 3; 53} 54 55// Summary of coverage in each language 56message LanguageCoverageSummary { 57 // This summary is for all files written in this programming language. 58 Language language = 1; 59 60 // Summary of lines covered vs instrumented. 61 LineCoverageSummary line_summary = 2; 62 63 // Summary of branch coverage. 64 BranchCoverageSummary branch_summary = 3; 65} 66