diff options
| author | gingerBill <bill@gingerbill.org> | 2020-11-17 20:33:15 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-11-17 20:33:15 +0000 |
| commit | ef2f204c58f355daf516c25e6e59dcd60bce444d (patch) | |
| tree | b82e1c266b6c1fe7bd47c5c62a72d225033b3b9a /src/checker.cpp | |
| parent | 30765475c683c03ba587e51534feda756036e45f (diff) | |
Improve `system_exec_command_line_app` functionality; Restrict `test_*` procedures to `*_test.odin` files
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index 61b1e4bae..3339b6bfc 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -1864,10 +1864,14 @@ void generate_minimum_dependency_set(Checker *c, Entity *start) { if (e->kind != Entity_Procedure) { continue; } + + if (e->file == nullptr || !e->file->is_test) { + continue; + } + String name = e->token.string; String prefix = str_lit("test_"); - if (!string_starts_with(name, prefix)) { continue; } @@ -1876,9 +1880,7 @@ void generate_minimum_dependency_set(Checker *c, Entity *start) { if (name != prefix) { is_tester = true; } else { - if (e->file && e->file->is_test) { - error(e->token, "Invalid testing procedure name: %.*s", LIT(name)); - } + error(e->token, "Invalid testing procedure name: %.*s", LIT(name)); } Type *t = base_type(e->type); |