── Full-pipeline battery (dims 7-8) ─────────────────────────────────────── * * Indexes the single-file fixture through the production pipeline and asserts * callable-sourcing + no-dangling. Used for NICKEL, JSONNET, and STARLARK * which all have both func_types and call_types. * * Dim 7 RED contract notes per language: * NICKEL -- infix_expr call nodes represent operator application; th
| 333 | * Returns 0 on PASS, 1 on FAIL. |
| 334 | */ |
| 335 | static int config_pipeline_battery(const char *lang_tag, const char *filename, |
| 336 | const char *src) { |
| 337 | const char *RED = tf_red(); |
| 338 | const char *RST = tf_reset(); |
| 339 | |
| 340 | RFile files[1]; |
| 341 | files[0].name = filename; |
| 342 | files[0].content = src; |
| 343 | |
| 344 | RProj lp; |
| 345 | cbm_store_t *store = rh_index_files(&lp, files, 1); |
| 346 | if (!store) { |
| 347 | printf(" %sFAIL%s [%s] pipeline: rh_index_files returned NULL\n", |
| 348 | RED, RST, lang_tag); |
| 349 | return 1; |
| 350 | } |
| 351 | |
| 352 | int fails = 0; |
| 353 | |
| 354 | /* 7. callable-sourcing */ |
| 355 | int module_sourced = 0; |
| 356 | int callable_sourced = 0; |
| 357 | inv_count_calls_by_source(store, lp.project, &module_sourced, |
| 358 | &callable_sourced); |
| 359 | if (module_sourced != 0) { |
| 360 | printf(" %sFAIL%s [%s] callable-sourcing: %d in-body CALLS sourced at " |
| 361 | "Module (callable=%d) -- enclosing-func gap\n", |
| 362 | RED, RST, lang_tag, module_sourced, callable_sourced); |
| 363 | fails++; |
| 364 | } else if (callable_sourced < 1) { |
| 365 | printf(" %sFAIL%s [%s] callable-sourcing: 0 CALLS edges (fixture " |
| 366 | "produced no in-body call edge to attribute)\n", |
| 367 | RED, RST, lang_tag); |
| 368 | fails++; |
| 369 | } |
| 370 | |
| 371 | /* 8. no-dangling */ |
| 372 | int dangling = inv_count_dangling_edges(store, lp.project, "CALLS"); |
| 373 | if (dangling != 0) { |
| 374 | printf(" %sFAIL%s [%s] no-dangling: %d dangling CALLS endpoint(s)\n", |
| 375 | RED, RST, lang_tag, dangling); |
| 376 | fails++; |
| 377 | } |
| 378 | |
| 379 | rh_cleanup(&lp, store); |
| 380 | return fails ? 1 : 0; |
| 381 | } |
| 382 | |
| 383 | /* ── Robustness helper: assert call RETURNS on malformed input ─────────────── |
| 384 | * |
no test coverage detected