| 62 | } |
| 63 | |
| 64 | static bool diagnostics_wait_for_file(const char *path, unsigned int timeout_ms) { |
| 65 | uint64_t deadline = cbm_now_ms() + timeout_ms; |
| 66 | while (cbm_now_ms() < deadline) { |
| 67 | if (cbm_file_exists(path)) { |
| 68 | return true; |
| 69 | } |
| 70 | diagnostics_wait_ms(10); |
| 71 | } |
| 72 | return cbm_file_exists(path); |
| 73 | } |
| 74 | |
| 75 | static char *diagnostics_read_file(const char *path) { |
| 76 | FILE *file = cbm_fopen(path, "rb"); |
no test coverage detected