• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

thoni56 / c-xrefactory / 1598

08 Oct 2025 10:56AM UTC coverage: 25.401% (-54.8%) from 80.177%
1598

push

travis-ci

thoni56
Add llvm-cov to gcov conversion for Emacs cov-mode support

- Create llvm2gcov.sh script to convert Apple coverage to traditional format
- Parse llvm-cov show output and transform to gcov-compatible format
- Handle count formats including 'k' suffix (4.18k -> 4180)
- Generate proper gcov headers for Emacs compatibility
- Integrate conversion into Darwin gcov target
- Preserve full Emacs fringe coverage display functionality

Now Darwin users get both:
- Superior Apple coverage accuracy
- Full Emacs cov-mode integration

4019 of 15822 relevant lines covered (25.4%)

3416.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.24
src/commandlogger.c
1
#include "commandlogger.h"
2

3
#include <string.h>
4
#include <stdlib.h>
5

6
#include "constants.h"
7
#include "fileio.h"
8
#include "options.h"
9

10

11
static FILE *commandsLogfile = NULL;
12

13
static char *removePattern(char *source, const char *pattern) {
8✔
14
    char* matchPosition;
15
    int lenPattern = strlen(pattern);
8✔
16
    char *modifiableCopy = strcpy(malloc(strlen(source)+1), source);
8✔
17

18
    while ((matchPosition = strstr(modifiableCopy, pattern)) != NULL) {
9✔
19
        // Move the rest of the string to overwrite the pattern
20
        memmove(matchPosition, matchPosition + lenPattern, strlen(matchPosition + lenPattern) + 1);
1✔
21
    }
22
    return modifiableCopy;
8✔
23
}
24

25
void logCommands(int argc, char *argv[]) {
4✔
26
    if (!options.commandlog)
4✔
27
        return;
×
28

29
    if (commandsLogfile == NULL)
4✔
30
        commandsLogfile = openFile(options.commandlog, "w");
4✔
31

32
    char cwd[MAX_FILE_NAME_SIZE];
33
    getCwd(cwd, sizeof(cwd));
4✔
34
    strcat(cwd, "/");
4✔
35

36
    for (int i=0; i<argc-1; i++) {
10✔
37
        if (argv[i] != NULL) {
6✔
38
            char *cleaned = removePattern(argv[i], cwd);
4✔
39
            writeFile(commandsLogfile, cleaned, strlen(cleaned), 1);
4✔
40
            writeFile(commandsLogfile, " ", 1, 1);
4✔
41
        }
42
    }
43
    char *cleaned = removePattern(argv[argc-1], cwd);
4✔
44
    writeFile(commandsLogfile, cleaned, strlen(cleaned), 1);
4✔
45
    writeFile(commandsLogfile, "\n", 1, 1);
4✔
46
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc