Fixture-dir provider: tests/fixtures/complexity/ / — every file * and directory in it (dot-names aside) is copied verbatim into each module * dir. Lets a new language join the * guard by dropping fixtures, with no edit to this suite. */
| 183 | * dir. Lets a new language join the |
| 184 | * guard by dropping fixtures, with no edit to this suite. */ |
| 185 | static bool cx_fixture_dir_for(CBMLanguage lang, char *out, size_t cap) { |
| 186 | const char *name = cbm_language_name(lang); |
| 187 | if (!name || !name[0]) { |
| 188 | return false; |
| 189 | } |
| 190 | snprintf(out, cap, "tests/fixtures/complexity/%s", name); |
| 191 | cbm_dir_t *d = cbm_opendir(out); |
| 192 | if (!d) { |
| 193 | return false; |
| 194 | } |
| 195 | cbm_closedir(d); |
| 196 | return true; |
| 197 | } |
| 198 | |
| 199 | static int cx_copy_file(const char *src, const char *dst) { |
| 200 | FILE *in = fopen(src, "rb"); |
no test coverage detected