$npx -y skills add gadievron/raptor --skill line-execution-checkerCheck if specific lines were executed using gcov data
| 1 | # Line Execution Checker |
| 2 | |
| 3 | ## Purpose |
| 4 | Fast tool to check if specific source lines were executed during test runs. |
| 5 | |
| 6 | ## Tool: line-checker |
| 7 | |
| 8 | ### Build |
| 9 | ```bash |
| 10 | g++ -O3 -std=c++17 line_checker.cpp -o line-checker |
| 11 | ``` |
| 12 | |
| 13 | ### Usage |
| 14 | ```bash |
| 15 | # Single line |
| 16 | ./line-checker file.c:42 |
| 17 | |
| 18 | # Multiple lines |
| 19 | ./line-checker file.c:42 main.c:100 util.c:55 |
| 20 | ``` |
| 21 | |
| 22 | ### Output |
| 23 | ``` |
| 24 | file.c:42 EXECUTED (5 times) |
| 25 | main.c:100 NOT EXECUTED |
| 26 | util.c:55 EXECUTED (12 times) |
| 27 | ``` |
| 28 | |
| 29 | ### Exit Codes |
| 30 | - 0: All lines executed |
| 31 | - 1: One or more lines NOT executed |
| 32 | - 2: Error |
| 33 | |
| 34 | ## Prerequisites |
| 35 | Coverage data must exist from prior test run with `--coverage` flag. |
| 36 | |
| 37 | ## When User Asks |
| 38 | "Was line X of file.c executed?" or "Check if these lines were covered" |
| 39 | |
| 40 | ### Steps |
| 41 | 1. Verify `.gcda` files exist: `find . -name "*.gcda" -print -quit` |
| 42 | 2. Build tool if needed: `g++ -O3 -std=c++17 line_checker.cpp -o line-checker` |
| 43 | 3. Run: `./line-checker file.c:X` |
| 44 | 4. Report result to user |
| 45 | |
| 46 | ## Example Interaction |
| 47 | User: "Was line 127 in parser.c executed?" |
| 48 | |
| 49 | ```bash |
| 50 | ./line-checker parser.c:127 |
| 51 | # Output: parser.c:127 EXECUTED (3 times) |
| 52 | ``` |
| 53 | |
| 54 | Response: "Yes, line 127 was executed 3 times during testing." |