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:
Feoramund
2024-06-01 07:04:20 -04:00
parent 6a5d51f0d6
commit cb8faf5b74
3 changed files with 0 additions and 54 deletions

View File

@@ -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;
}
}
}