diff --git a/BeefLibs/corlib/src/Attribute.bf b/BeefLibs/corlib/src/Attribute.bf index bc6b8a09..ad27c2c2 100644 --- a/BeefLibs/corlib/src/Attribute.bf +++ b/BeefLibs/corlib/src/Attribute.bf @@ -457,6 +457,7 @@ namespace System public bool Ignore; public bool Profile; public String Tag; + public String Name; } public struct ImportAttribute : Attribute diff --git a/IDE/src/TestManager.bf b/IDE/src/TestManager.bf index c2d4cd2c..8252463b 100644 --- a/IDE/src/TestManager.bf +++ b/IDE/src/TestManager.bf @@ -388,10 +388,25 @@ namespace IDE testEntry.mLine = int32.Parse(cmdParts[3]).Get(); testEntry.mColumn = int32.Parse(cmdParts[4]).Get(); - testEntry.mShouldFail = attribs.Contains("Sf"); - testEntry.mProfile = attribs.Contains("Pr"); - testEntry.mIgnore = attribs.Contains("Ig"); + List attributes = scope .(attribs.Split('\a')); + for(var i in attributes) + { + if(i.StartsWith('\v')) + { + if(i == "Sf") + testEntry.mShouldFail = true; + else if(i == "Pr") + testEntry.mProfile = true; + else if(i == "Ig") + testEntry.mIgnore = true; + } + else if(i.StartsWith("Name")) + { + testEntry.mName.Clear(); + scope String(i.Substring("Name".Length)).Escape(testEntry.mName); + } + } testInstance.mTestEntries.Add(testEntry); } } diff --git a/IDEHelper/Compiler/BfCompiler.cpp b/IDEHelper/Compiler/BfCompiler.cpp index 7bb4e946..e7625aa9 100644 --- a/IDEHelper/Compiler/BfCompiler.cpp +++ b/IDEHelper/Compiler/BfCompiler.cpp @@ -951,15 +951,31 @@ void BfCompiler::EmitTestMethod(BfVDataModule* bfModule, Array& test BfFieldDef* fieldDef = field.mFieldRef; if (fieldDef->mName == "ShouldFail") { - testMethod.mName += "Sf"; + testMethod.mName += "Sf\a"; } else if (fieldDef->mName == "Profile") { - testMethod.mName += "Pr"; + testMethod.mName += "Pr\a"; } else if (fieldDef->mName == "Ignore") { - testMethod.mName += "Ig"; + testMethod.mName += "Ig\a"; + } + } + else if ((constant != NULL) && (constant->mTypeCode == BfTypeCode_StringId)) + { + BfFieldDef* fieldDef = field.mFieldRef; + if (fieldDef->mName == "Name") + { + String* str = bfModule->GetStringPoolString(field.mParam.mValue, typeInstance->mConstHolder); + testMethod.mName += "Name"; + String* temp = new String(*str); + temp->Replace('\t', "\\t"); //Good enough for now + temp->Replace('\n', "\\n"); + temp->Replace('\a', "\\a"); + temp->Replace('\v', "\\v"); + testMethod.mName += *temp; + testMethod.mName += "\a"; } } }