mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-03 19:52:30 +00:00
Remove -test-name in favor of test runner option
`-define:ODIN_TEST_NAMES=...` is capable of selecting test by package and name or name only, with the ability to access packages included by `-all-packages`.
This commit is contained in:
@@ -5852,35 +5852,6 @@ gb_internal void remove_neighbouring_duplicate_entires_from_sorted_array(Array<E
|
||||
gb_internal void check_test_procedures(Checker *c) {
|
||||
array_sort(c->info.testing_procedures, init_procedures_cmp);
|
||||
remove_neighbouring_duplicate_entires_from_sorted_array(&c->info.testing_procedures);
|
||||
|
||||
if (build_context.test_names.entries.count == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
AstPackage *pkg = c->info.init_package;
|
||||
Scope *s = pkg->scope;
|
||||
|
||||
for (String const &name : build_context.test_names) {
|
||||
Entity *e = scope_lookup(s, name);
|
||||
if (e == nullptr) {
|
||||
Token tok = {};
|
||||
if (pkg->files.count != 0) {
|
||||
tok = pkg->files[0]->tokens[0];
|
||||
}
|
||||
error(tok, "Unable to find the test '%.*s' in 'package %.*s' ", LIT(name), LIT(pkg->name));
|
||||
}
|
||||
}
|
||||
|
||||
for (isize i = 0; i < c->info.testing_procedures.count; /**/) {
|
||||
Entity *e = c->info.testing_procedures[i];
|
||||
String name = e->token.string;
|
||||
if (!string_set_exists(&build_context.test_names, name)) {
|
||||
array_ordered_remove(&c->info.testing_procedures, i);
|
||||
} else {
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user