mikefourie-zz / MSBuildExtensionPack

MIT License
366 stars 104 forks source link

Nunit: The "TimeTaken" parameter is not marked for output #12

Closed BrunoJuchli closed 9 years ago

BrunoJuchli commented 9 years ago

Hi (First off, thanks for your great work)

I'm currently debugging an odd behavior with nunit. I've got some unit test which is reported to take 3.5seconds, but the build actually takes 30 seconds longer than without it. But this is only when run by means of msbuild, not when run inside visual studio.

So i was trying to access the MSBuild.ExtensionPack.CodeQuality.NUnit TimeTaken Property. As per the documentation it seems i could access it as follows:

    <MSBuild.ExtensionPack.CodeQuality.NUnit
        Assemblies="$(TargetPath)"
        OutputXmlFile="$(TestResultsFile)"
        ToolPath="C:\Program Files (x86)\NUnit 2.6.3\bin\"
        Framework="net-4.5.1" 
        Version="2.6.3" >
        <Output TaskParameter="TimeTaken" PropertyName="TimeTaken"/>   
     </MSBuild.ExtensionPack.CodeQuality.NUnit>

However, msbuild then complains: The "TimeTaken" parameter is not marked for output by the "MSBuild.ExtensionPack.CodeQuality.NUnit" task.

Now it might be that I'm doing something wrong, but for the other result values (Total, NotRun,...) the documentation shows to access them using the <Output ...> way. So i think that the [Output]-Attribute has just been forgotten on the Property.

Am i right? I'll gladly provide a pull request.

mikefourie-zz commented 9 years ago

This is a bug. TimeTaken is not used at all in the code. Feel free to submit a pull request, otherwise I'll try fix is soon(ish)

Mike