Check if specific lines were executed using gcov data
Fast tool to check if specific source lines were executed during test runs.
Always build fresh from this skill's line_checker.cpp, into a scratch
directory YOU create — never into (or from) the coverage/build directory.
That directory is written by the instrumented target's own build and run,
so any pre-existing line-checker found there could have been planted by
the analysed program to forge coverage verdicts; never execute one.
CHECKER_DIR=$(mktemp -d)
g++ -O3 -std=c++17 line_checker.cpp -o "$CHECKER_DIR/line-checker"# Single line (from the coverage data directory)
"$CHECKER_DIR/line-checker" file.c:42
# Multiple lines
"$CHECKER_DIR/line-checker" file.c:42 main.c:100 util.c:55file.c:42 EXECUTED (5 times)
main.c:100 NOT EXECUTED
util.c:55 EXECUTED (12 times)Coverage data must exist from prior test run with --coverage flag.
"Was line X of file.c executed?" or "Check if these lines were covered"
.gcda files exist: find . -name "*.gcda" -print -quitline-checker binary found in the coverage/build tree):
CHECKER_DIR=$(mktemp -d) && g++ -O3 -std=c++17 line_checker.cpp -o "$CHECKER_DIR/line-checker""$CHECKER_DIR/line-checker" file.c:XUser: "Was line 127 in parser.c executed?"
"$CHECKER_DIR/line-checker" parser.c:127
# Output: parser.c:127 EXECUTED (3 times)Response: "Yes, line 127 was executed 3 times during testing."
gadievron/raptor
5480e95
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.