Index the fixture; false (after cleanup) when the run itself fails. */
| 23226 | |
| 23227 | /* Index the fixture; false (after cleanup) when the run itself fails. */ |
| 23228 | static bool cpp_recv_open(CppRecvRun *r, bool parallel) { |
| 23229 | memset(r, 0, sizeof(*r)); |
| 23230 | snprintf(r->tmp, sizeof(r->tmp), "/tmp/cbm_cpp_recv_XXXXXX"); |
| 23231 | if (!cbm_mkdtemp(r->tmp)) { |
| 23232 | r->tmp[0] = '\0'; |
| 23233 | return false; |
| 23234 | } |
| 23235 | cpp_recv_write_fixture(r->tmp, parallel); |
| 23236 | const char *old_workers = getenv("CBM_WORKERS"); |
| 23237 | r->saved_workers = old_workers ? strdup(old_workers) : NULL; |
| 23238 | cbm_setenv("CBM_WORKERS", parallel ? "4" : "1", 1); |
| 23239 | snprintf(r->db, sizeof(r->db), "%s/cpp_recv.db", r->tmp); |
| 23240 | r->p = cbm_pipeline_new(r->tmp, r->db, CBM_MODE_FULL); |
| 23241 | if (!r->p || cbm_pipeline_run(r->p) != 0) { |
| 23242 | cpp_recv_close(r); |
| 23243 | return false; |
| 23244 | } |
| 23245 | r->s = cbm_store_open_path(r->db); |
| 23246 | r->project = cbm_pipeline_project_name(r->p); |
| 23247 | if (!r->s || !r->project || !cpp_recv_fixture_indexed(r)) { |
| 23248 | cpp_recv_close(r); |
| 23249 | return false; |
| 23250 | } |
| 23251 | return true; |
| 23252 | } |
| 23253 | |
| 23254 | /* Properties of the CALLS edge caller -> target (QNs below the project), or |
| 23255 | * NULL when there is no such edge. The caller frees the result. */ |
no test coverage detected