Line Execution Checker
Check if specific lines were executed using gcov data
Security Assessment
About Line Execution Checker
The Line Execution Checker is a tool designed to help developers determine if specific lines of code were executed during test runs. It leverages gcov data, a coverage analysis tool for C/C++ programs, to quickly verify whether the code has been adequately tested. By checking if certain lines in a program's source files have been executed, developers can ensure that their tests cover the necessary parts of their code, improving the reliability of their testing process and identifying areas that might require more attention.
FAQ
How do I check if a specific line was executed?
You can check if a line was executed by running the Line Execution Checker with the command `./line-checker file.c:X`, where `file.c` is the source file and `X` is the line number.
What happens if no coverage data is available?
The tool requires coverage data generated from a prior test run with the `--coverage` flag. If no `.gcda` files exist, the tool will not be able to check line execution.
Can I check multiple lines at once?
Yes, you can check multiple lines by specifying them in the command, such as `./line-checker file.c:42 main.c:100 util.c:55`.
What exit codes does the tool use?
The tool uses the following exit codes: 0 if all lines were executed, 1 if one or more lines were not executed, and 2 for errors.
Which C++ standard does the tool require?
The tool requires C++17, and should be built using the `g++ -O3 -std=c++17 line_checker.cpp -o line-checker` command.
Install Line Execution Checker
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
gadievron/raptor