Skip to content

Commit c1c03fd

Browse files
Fixed coverage instrumentation (fixes #283) (#327)
* use C90 comments * updated CHANGELOG.md * bug fix: allow coverage instrumentation for C programs * release v2.1.16
1 parent f5074b8 commit c1c03fd

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
## 2.1.26 (XXXX-XX-XX)
1+
## 2.1.26 (2019-03-14)
22

33
### Bug Fixes
44

55
* Fixed a hardcoded log directory in BugZoo CLI.
6+
* Updated coverage instrumentation to use C90-compatible comments.
7+
* Update coverage instrumentation to support C.
68

79

810
## 2.1.25 (2019-02-09)

bugzoo/mgr/coverage/gcov.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@
1616
logger.setLevel(logging.DEBUG)
1717

1818
INSTRUMENTATION = (
19-
"// BUGZOO :: INSTRUMENTATION :: START\n"
19+
"/* BUGZOO :: INSTRUMENTATION :: START */\n"
2020
"#include <stdio.h>\n"
2121
"#include <stdlib.h>\n"
2222
"#include <signal.h>\n"
23-
"extern \"C\" void __gcov_flush(void);\n"
23+
"#ifdef __cplusplus\n"
24+
" extern \"C\" void __gcov_flush(void);\n"
25+
"#else\n"
26+
" void __gcov_flush(void);\n"
27+
"#endif\n"
2428
"void bugzoo_sighandler(int sig){\n"
2529
" __gcov_flush();\n"
2630
" if(sig != SIGUSR1 && sig != SIGUSR2)\n"
@@ -40,11 +44,11 @@
4044
" sigaction(SIGBUS, &new_action, NULL);\n"
4145
" sigaction(SIGILL, &new_action, NULL);\n"
4246
" sigaction(SIGABRT, &new_action, NULL);\n"
43-
" // Use signal for SIGUSR to remove handlers\n"
47+
" /* Use signal for SIGUSR to remove handlers */\n"
4448
" signal(SIGUSR1, bugzoo_sighandler);\n"
4549
" signal(SIGUSR2, bugzoo_sighandler);\n"
4650
"}\n"
47-
"// BUGZOO :: INSTRUMENTATION :: END\n"
51+
"/* BUGZOO :: INSTRUMENTATION :: END */\n"
4852
)
4953

5054

0 commit comments

Comments
 (0)