Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
a8e0cfb1
Commit
a8e0cfb1
authored
Sep 26, 2010
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ccanlint: handle gcov where there's actually no C code
Macro packages do this.
parent
93aefd28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
tools/ccanlint/ccanlint.c
tools/ccanlint/ccanlint.c
+1
-1
tools/ccanlint/tests/run-coverage.c
tools/ccanlint/tests/run-coverage.c
+7
-4
No files found.
tools/ccanlint/ccanlint.c
View file @
a8e0cfb1
...
...
@@ -150,7 +150,7 @@ static bool run_test(struct ccanlint *i,
else
this_score
=
0
;
bad
=
(
this_score
==
0
);
bad
=
(
this_score
==
0
&&
i
->
total_score
!=
0
);
good
=
(
this_score
>=
i
->
total_score
);
if
(
verbose
||
(
bad
&&
!
quiet
))
{
...
...
tools/ccanlint/tests/run-coverage.c
View file @
a8e0cfb1
...
...
@@ -47,7 +47,7 @@ static void analyze_coverage(struct manifest *m,
unsigned
int
i
,
total_lines
=
0
;
bool
lines_matter
=
false
;
/*
FIXME: We assume GCOV mentions all files!
/*
Output looks like:
File '../../../ccan/tdb2/private.h'
Lines executed:0.00% of 8
...
...
@@ -99,10 +99,13 @@ static void analyze_coverage(struct manifest *m,
}
}
/* Nothing covered? */
if
(
total_lines
==
0
)
/* Nothing covered? We can't tell if there's a source file which
* was never executed, or there really is no code to execute, so
* assume the latter: this test deserves no score. */
if
(
total_lines
==
0
)
{
res
->
uncovered
=
1
.
0
;
else
run_coverage_tests
.
total_score
=
0
;
}
else
res
->
uncovered
=
1
.
0
-
covered_lines
/
total_lines
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment