Write a fixture whose `helper` in hot.py is called from `callers` other * files — the inbound edges that only exist project-wide, never in a delta * buffer. `tag` lets the caller perturb hot.py to force a re-parse. */
| 175 | * files — the inbound edges that only exist project-wide, never in a delta |
| 176 | * buffer. `tag` lets the caller perturb hot.py to force a re-parse. */ |
| 177 | static int imp_write_hot_fixture(const char *root, int callers, const char *tag) { |
| 178 | char body[256]; |
| 179 | snprintf(body, sizeof(body), "%sdef helper():\n return 1\n", tag); |
| 180 | if (th_write_file(TH_PATH(root, "hot.py"), body) != 0) { |
| 181 | return -1; |
| 182 | } |
| 183 | for (int i = 0; i < callers; i++) { |
| 184 | char rel[64]; |
| 185 | char src[192]; |
| 186 | snprintf(rel, sizeof(rel), "c%d.py", i); |
| 187 | snprintf(src, sizeof(src), "import hot\n\ndef use%d():\n return hot.helper()\n", i); |
| 188 | if (th_write_file(TH_PATH(root, rel), src) != 0) { |
| 189 | return -1; |
| 190 | } |
| 191 | } |
| 192 | return 0; |
| 193 | } |
| 194 | |
| 195 | /* ── Registration: the pass must actually execute ─────────────────────── */ |
| 196 |
no test coverage detected