mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Make test methods from extensions work (including static blocks)
This commit is contained in:
parent
7c03f5e2cd
commit
15a2cdfeed
1 changed files with 13 additions and 2 deletions
|
@ -827,7 +827,7 @@ void BfCompiler::GetTestMethods(BfVDataModule* bfModule, Array<TestMethod>& test
|
||||||
|
|
||||||
auto _CheckMethod = [&](BfTypeInstance* typeInstance, BfMethodInstance* methodInstance)
|
auto _CheckMethod = [&](BfTypeInstance* typeInstance, BfMethodInstance* methodInstance)
|
||||||
{
|
{
|
||||||
auto project = typeInstance->mTypeDef->mProject;
|
auto project = methodInstance->mMethodDef->mDeclaringType->mProject;
|
||||||
if (project->mTargetType != BfTargetType_BeefTest)
|
if (project->mTargetType != BfTargetType_BeefTest)
|
||||||
return;
|
return;
|
||||||
if (project != bfModule->mProject)
|
if (project != bfModule->mProject)
|
||||||
|
@ -897,6 +897,16 @@ void BfCompiler::GetTestMethods(BfVDataModule* bfModule, Array<TestMethod>& test
|
||||||
if (typeInstance == NULL)
|
if (typeInstance == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (typeInstance->mTypeDef->IsGlobalsContainer())
|
||||||
|
{
|
||||||
|
NOP;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeInstance->mTypeDef->mProject->mName == "BeefTest")
|
||||||
|
{
|
||||||
|
NOP;
|
||||||
|
}
|
||||||
|
|
||||||
if (typeInstance->IsUnspecializedType())
|
if (typeInstance->IsUnspecializedType())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -915,7 +925,8 @@ void BfCompiler::EmitTestMethod(BfVDataModule* bfModule, Array<TestMethod>& test
|
||||||
auto methodInstance = testMethod.mMethodInstance;
|
auto methodInstance = testMethod.mMethodInstance;
|
||||||
auto typeInstance = methodInstance->GetOwner();
|
auto typeInstance = methodInstance->GetOwner();
|
||||||
testMethod.mName += bfModule->TypeToString(typeInstance);
|
testMethod.mName += bfModule->TypeToString(typeInstance);
|
||||||
testMethod.mName += ".";
|
if (!testMethod.mName.IsEmpty())
|
||||||
|
testMethod.mName += ".";
|
||||||
testMethod.mName += methodInstance->mMethodDef->mName;
|
testMethod.mName += methodInstance->mMethodDef->mName;
|
||||||
|
|
||||||
testMethod.mName += "\t";
|
testMethod.mName += "\t";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue