File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change 6262        -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} 
6363        -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} 
6464        -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} 
65+         -DCODE_COVERAGE=ON 
6566        -S ${{ github.workspace }} 
6667
6768name : Build 
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.0)
33project (buffer_set)
44
55option (BUILD_TESTS "Build tests"  ON )
6+ option (CODE_COVERAGE "Enable code coverage reporting"  OFF )
67
78include_directories (include )
89
@@ -14,6 +15,11 @@ set(LIB_SRCS
1415add_library (buffer_set STATIC  ${LIB_SRCS} )
1516
1617if (BUILD_TESTS)
18+     if (CODE_COVERAGE AND  CMAKE_C_COMPILER_ID MATCHES  "GNU" )
19+         set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS}  --coverage" )
20+         set (CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS}  --coverage" )
21+     endif ()
22+ 
1723    set (TEST_SRCS
1824        tests/clear.c
1925        tests/insert .c
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments