From b84ee3ab8fc821183ca4fbdabf87bf2ed90f556c Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 18 Aug 2021 23:33:27 +0100 Subject: [PATCH] Fix `odin test` not executing any tests --- src/checker.cpp | 12 +++--------- 1 file 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;