| 1179 | } ObjectScriptExportObservation; |
| 1180 | |
| 1181 | static ObjectScriptExportObservation observe_objectscript_export(const char *repo_path, |
| 1182 | const char *db_name) { |
| 1183 | ObjectScriptExportObservation observation = { |
| 1184 | .run_rc = -1, |
| 1185 | .store_opened = false, |
| 1186 | .run_nodes = -1, |
| 1187 | .execute_nodes = -1, |
| 1188 | .run_execute_calls = -1, |
| 1189 | .shared_payload_nodes = -1, |
| 1190 | .run_shared_payload_usages = -1, |
| 1191 | }; |
| 1192 | char db_path[512]; |
| 1193 | snprintf(db_path, sizeof(db_path), "%s/%s", repo_path, db_name); |
| 1194 | cbm_pipeline_t *pipeline = cbm_pipeline_new(repo_path, db_path, CBM_MODE_FULL); |
| 1195 | if (!pipeline) { |
| 1196 | return observation; |
| 1197 | } |
| 1198 | |
| 1199 | observation.run_rc = cbm_pipeline_run(pipeline); |
| 1200 | const char *project = cbm_pipeline_project_name(pipeline); |
| 1201 | cbm_store_t *store = cbm_store_open_path(db_path); |
| 1202 | observation.store_opened = store != NULL; |
| 1203 | if (store && project) { |
| 1204 | observation.run_nodes = named_node_count(store, project, "Run"); |
| 1205 | observation.execute_nodes = named_node_count(store, project, "Execute"); |
| 1206 | observation.run_execute_calls = named_edge_count(store, project, "CALLS", "Run", "Execute"); |
| 1207 | observation.shared_payload_nodes = named_node_count(store, project, "SharedPayload"); |
| 1208 | observation.run_shared_payload_usages = |
| 1209 | named_edge_count(store, project, "USAGE", "Run", "SharedPayload"); |
| 1210 | } |
| 1211 | if (store) { |
| 1212 | cbm_store_close(store); |
| 1213 | } |
| 1214 | cbm_pipeline_free(pipeline); |
| 1215 | return observation; |
| 1216 | } |
| 1217 | |
| 1218 | /* Studio Export XML is transformed into ObjectScript UDL during extraction. |
| 1219 | * The transformed definitions already survive, but the old sequential and |
no test coverage detected