| 48 | } |
| 49 | |
| 50 | static double measure(int n_classes, int *out_calls, int *out_resolved) { |
| 51 | int slen = 0; |
| 52 | char *src = build_fixture(n_classes, &slen); |
| 53 | if (!src) return -1.0; |
| 54 | struct timespec t0, t1; |
| 55 | clock_gettime(CLOCK_MONOTONIC, &t0); |
| 56 | CBMFileResult *r = cbm_extract_file(src, slen, CBM_LANG_PYTHON, |
| 57 | "test", "scale.py", 0, NULL, NULL); |
| 58 | clock_gettime(CLOCK_MONOTONIC, &t1); |
| 59 | double ms = elapsed_ms(t0, t1); |
| 60 | if (out_calls) *out_calls = r ? r->calls.count : 0; |
| 61 | if (out_resolved) *out_resolved = r ? r->resolved_calls.count : 0; |
| 62 | if (r) cbm_free_result(r); |
| 63 | free(src); |
| 64 | return ms; |
| 65 | } |
| 66 | |
| 67 | TEST(pylsp_scale_linear_growth) { |
| 68 | int c100 = 0, r100 = 0; |
no test coverage detected