aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-08-18 23:33:27 +0100
committergingerBill <bill@gingerbill.org>2021-08-18 23:33:27 +0100
commitb84ee3ab8fc821183ca4fbdabf87bf2ed90f556c (patch)
tree297b031641cd2093a7b5c6a3ffda92ae6893c205
parente023b96737f4d7ea3d94b7c48c9669d16e7f07d1 (diff)
Fix `odin test` not executing any tests
-rw-r--r--src/checker.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index f121bf9cc..de5dd9f3c 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -2053,21 +2053,18 @@ void generate_minimum_dependency_set(Checker *c, Entity *start) {
}
}
+
Entity *test_signature = scope_lookup_current(testing_scope, str_lit("Test_Signature"));
AstPackage *pkg = c->info.init_package;
Scope *s = pkg->scope;
+
for_array(i, s->elements.entries) {
Entity *e = s->elements.entries[i].value;
if (e->kind != Entity_Procedure) {
continue;
}
- // if (e->file == nullptr || !e->file->is_test) {
- if (e->file == nullptr) {
- continue;
- }
-
if ((e->flags & EntityFlag_Test) == 0) {
continue;
}
@@ -3224,6 +3221,7 @@ void check_collect_value_decl(CheckerContext *c, Ast *decl) {
}
Entity *e = alloc_entity_variable(c->scope, name->Ident.token, nullptr);
e->identifier = name;
+ e->file = c->file;
if (entity_visibility_kind != EntityVisiblity_Public) {
e->flags |= EntityFlag_NotExported;
@@ -4671,10 +4669,6 @@ void check_unchecked_bodies(Checker *c) {
}
void check_test_procedures(Checker *c) {
- if (build_context.test_names.entries.count == 0) {
- return;
- }
-
AstPackage *pkg = c->info.init_package;
Scope *s = pkg->scope;