── Shared full-pipeline battery (dimensions 7-8) ────────────────────────── * * Indexes the single-file fixture through the production pipeline and asserts * callable-sourcing (no Module-sourced in-body CALLS) and no dangling CALLS * edges. Returns 0 on PASS, 1 on FAIL. Dimension 7 is RED for the dynamic * languages whose enclosing-func detection or call extraction is missing * (Perl/R/Julia
| 181 | * (Perl/R/Julia/Groovy/Dart) -- that is the intended signal. |
| 182 | */ |
| 183 | static int pipeline_battery(const char *lang_tag, const char *filename, |
| 184 | const char *src) { |
| 185 | const char *RED = tf_red(); |
| 186 | const char *RST = tf_reset(); |
| 187 | |
| 188 | RFile files[1]; |
| 189 | files[0].name = filename; |
| 190 | files[0].content = src; |
| 191 | |
| 192 | RProj lp; |
| 193 | cbm_store_t *store = rh_index_files(&lp, files, 1); |
| 194 | if (!store) { |
| 195 | printf(" %sFAIL%s [%s] pipeline: rh_index_files returned NULL\n", |
| 196 | RED, RST, lang_tag); |
| 197 | return 1; |
| 198 | } |
| 199 | |
| 200 | int fails = 0; |
| 201 | |
| 202 | /* 7. callable-sourcing -- mod must be 0; we also require >=1 callable-sourced |
| 203 | * edge so a fixture that produced zero CALLS edges cannot vacuously pass. */ |
| 204 | int module_sourced = 0; |
| 205 | int callable_sourced = 0; |
| 206 | inv_count_calls_by_source(store, lp.project, &module_sourced, |
| 207 | &callable_sourced); |
| 208 | if (module_sourced != 0) { |
| 209 | printf(" %sFAIL%s [%s] callable-sourcing: %d in-body CALLS sourced at " |
| 210 | "Module (callable=%d) -- known enclosing-func gap\n", |
| 211 | RED, RST, lang_tag, module_sourced, callable_sourced); |
| 212 | fails++; |
| 213 | } else if (callable_sourced < 1) { |
| 214 | printf(" %sFAIL%s [%s] callable-sourcing: 0 CALLS edges (fixture " |
| 215 | "produced no in-body call edge to attribute)\n", |
| 216 | RED, RST, lang_tag); |
| 217 | fails++; |
| 218 | } |
| 219 | |
| 220 | /* 8. no-dangling -- every CALLS edge endpoint must resolve. */ |
| 221 | int dangling = inv_count_dangling_edges(store, lp.project, "CALLS"); |
| 222 | if (dangling != 0) { |
| 223 | printf(" %sFAIL%s [%s] no-dangling: %d dangling CALLS endpoint(s)\n", |
| 224 | RED, RST, lang_tag, dangling); |
| 225 | fails++; |
| 226 | } |
| 227 | |
| 228 | rh_cleanup(&lp, store); |
| 229 | return fails ? 1 : 0; |
| 230 | } |
| 231 | |
| 232 | /* ── Python ───────────────────────────────────────────────────────────────── |
| 233 | * Idiomatic: import, a free function, a class with a method, in-body call. |
no test coverage detected