質問

I'm currently using the default build process template in TFS 2013 for my automated builds.

I've configured the OutputLocation parameter to be AsConfigured to get the same folder structure as my Visual Studio solution (there are multiple projects in the solution and I don't want them all to be dropped in the same folder).

The problem is that when the build process tries to run the tests, it looks for any assembly under the bin folder, while my build configuration makes it so that there is only a src folder.

Is there a way to specify looking into the src folder instead? Shouldn't it be the default anyway when using the AsConfigured setting?

Edit: Just to make it clear, there are usually 3 folders generated when running a TFS automated build (src, bin, tst). When using AsConfigured for the output location, there is no bin folder. I tried a suggestion which required changing the Test sources spec setting of the build process, and I get the same problem as before:

There were no matches for the search pattern C:\Builds\8\MyProject\MyBuildDefinition\bin\***test*.dll
役に立ちましたか?

解決

What I ended up doing is using a PowerShell script as a post-build event to copy my test assemblies to the bin folder of the build.

There are PowerShell scripts made available for TFS 2013 on CodePlex, and I modified this one slightly to accomodate my needs.

By doing this, I was able to use the default settings for running the tests, and it worked like a charm.

他のヒント

In your build definition, change the value of setting "Test Sources spec" to ***test*.dll (assuming your unit tests assemblies are suffixed with .test.dll)

EDIT: Please use **\*test*.dll;**\*test*.appx

Try to use this file masks: ..\**\*test*.dll

It works for me.

I have "AsConfigured" setting on for X64 platform that places the binaries into src\x64\Release\ (and it used to place them into bin\x64\Release\ without that switch). So, I ended up using ..\..\..\src\**\*test*.dll as my "Test Sources spec".

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top