coverage_summary.proto 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Copyright 2021 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. syntax = "proto3";
  15. package google.devtools.resultstore.v2;
  16. import "google/devtools/resultstore/v2/common.proto";
  17. option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
  18. option java_multiple_files = true;
  19. option java_outer_classname = "CoverageSummaryProto";
  20. option java_package = "com.google.devtools.resultstore.v2";
  21. // Summary of line coverage
  22. message LineCoverageSummary {
  23. // Number of lines instrumented for coverage.
  24. int32 instrumented_line_count = 1;
  25. // Number of instrumented lines that were executed by the test.
  26. int32 executed_line_count = 2;
  27. }
  28. // Summary of branch coverage
  29. // A branch may be:
  30. // * not executed. Counted only in total.
  31. // * executed but not taken. Appears in total and executed.
  32. // * executed and taken. Appears in all three fields.
  33. message BranchCoverageSummary {
  34. // The number of branches present in the file.
  35. int32 total_branch_count = 1;
  36. // The number of branches executed out of the total branches present.
  37. // A branch is executed when its condition is evaluated.
  38. // This is <= total_branch_count as not all branches are executed.
  39. int32 executed_branch_count = 2;
  40. // The number of branches taken out of the total branches executed.
  41. // A branch is taken when its condition is satisfied.
  42. // This is <= executed_branch_count as not all executed branches are taken.
  43. int32 taken_branch_count = 3;
  44. }
  45. // Summary of coverage in each language
  46. message LanguageCoverageSummary {
  47. // This summary is for all files written in this programming language.
  48. Language language = 1;
  49. // Summary of lines covered vs instrumented.
  50. LineCoverageSummary line_summary = 2;
  51. // Summary of branch coverage.
  52. BranchCoverageSummary branch_summary = 3;
  53. }