Begin rudimentary work on implementing odin test tooling with *_test.odin files

This commit is contained in:
gingerBill
2020-11-17 18:50:30 +00:00
parent 11577db6a8
commit 2bd0fd932a
7 changed files with 102 additions and 16 deletions
+16 -2
View File
@@ -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;