Skip to content

Commit 3d2d5a9

Browse files
committed
Quick example for public/interface public coverage
1 parent 5f42869 commit 3d2d5a9

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
cmake_minimum_required(VERSION 3.13)
2+
project(test C)
3+
4+
include(../../code-coverage.cmake)
5+
6+
add_library(head INTERFACE)
7+
target_code_coverage(head INTERFACE)
8+
9+
add_executable(test code.c)
10+
target_link_libraries(test PRIVATE head)
11+
# target_code_coverage(test)

example/code-coverage-public/code.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include "header.h"
2+
3+
int main() { return func(); }

example/code-coverage-public/header.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int func() { return 0; }

0 commit comments

Comments
 (0)