diff options
| author | gingerBill <bill@gingerbill.org> | 2020-11-17 18:50:30 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-11-17 18:50:30 +0000 |
| commit | 2bd0fd932a4eb1c2e6bc8702450c230186bb3c44 (patch) | |
| tree | 7f3441c0de7036aaa3f67aaa1edf4f610984f35c /src/build_settings.cpp | |
| parent | 11577db6a84d17998478dc22b607a203cdf00a7e (diff) | |
Begin rudimentary work on implementing `odin test` tooling with `*_test.odin` files
Diffstat (limited to 'src/build_settings.cpp')
| -rw-r--r-- | src/build_settings.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/build_settings.cpp b/src/build_settings.cpp index 0e8f2c5bc..35dc9a7c1 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -111,9 +111,10 @@ enum CommandKind : u32 { Command_query = 1<<4, Command_doc = 1<<5, Command_version = 1<<6, + Command_test = 1<<7, - Command__does_check = Command_run|Command_build|Command_check|Command_query|Command_doc, - Command__does_build = Command_run|Command_build, + Command__does_check = Command_run|Command_build|Command_check|Command_query|Command_doc|Command_test, + Command__does_build = Command_run|Command_build|Command_test, Command_all = ~(u32)0, }; @@ -333,6 +334,19 @@ bool is_excluded_target_filename(String name) { String original_name = name; name = remove_extension_from_path(name); + if (string_starts_with(name, str_lit("."))) { + // Ignore .*.odin files + return true; + } + + String test_suffix = str_lit("_test"); + if (build_context.command_kind != Command_test) { + if (string_ends_with(name, test_suffix) && name != test_suffix) { + // Ignore *_test.odin files + return true; + } + } + String str1 = {}; String str2 = {}; isize n = 0; |