Exclude methods from code coverage with Cobertura

后端 未结 5 1681
情话喂你
情话喂你 2020-11-27 14:22

Is there a way to exclude code from inclusion into Cobertura coverage reports? We have some methods that should not be included in the coverage report and therefore not driv

5条回答
  •  盖世英雄少女心
    2020-11-27 15:17

    You can exclude classes from instrumentation. Then they should not appear on reports. See exclude statements below.

    You can also ignore calls to some methods. See ignore statement below.

    If you are using maven, see maven plugin manual.

        
          
            
              com.example.boringcode.*
            
            
              com/example/dullcode/**/*.class
              com/example/**/*Test.class
            
          
        
    

    And for ant see this.

    
      
      
        
        
      
      
        
      
    
    

提交回复
热议问题