在VS2008上运行单元测试期间复制的隐藏文件夹

时间:2021-12-29 01:44:55

I've found that when running a VS2008 unit test that a hidden .svn subversion folder is copied under the Out folder that the unit test creates. This is because I've labeled a Resources folder in my unit test as "Additional File and Folder to deploy." Anybody know if you can mark a folder (in this case the .svn folder) as an exclude?

我发现在运行VS2008单元测试时,隐藏的.svn subversion文件夹被复制到单元测试创​​建的Out文件夹下。这是因为我在单元测试中将一个Resources文件夹标记为“要部署的附加文件和文件夹”。有人知道你是否可以将文件夹(在本例中为.svn文件夹)标记为排除?

1 个解决方案

#1


1  

You only can include single files or whole folders. The problem is that the deployment takes time. The less files are copied, the faster start you tests.

您只能包含单个文件或整个文件夹。问题是部署需要时间。复制的文件越少,测试开始的速度就越快。

Alternatively you can run your tests in the solutions out folder, by disabling "deployment". But I wouldn't do it. Or you can try to copy it yourself, for instance in a method marked with [AssemblyInitialize]. You get a TestContext, which has the property TestDeploymentDir. If you don't really have to optimize it, don't do it.

或者,您可以通过禁用“部署”在解决方案输出文件夹中运行测试。但我不会这样做。或者您可以尝试自己复制,例如在标有[AssemblyInitialize]的方法中。你得到一个TestContext,它有属性TestDeploymentDir。如果你真的不需要优化它,不要这样做。

#1


1  

You only can include single files or whole folders. The problem is that the deployment takes time. The less files are copied, the faster start you tests.

您只能包含单个文件或整个文件夹。问题是部署需要时间。复制的文件越少,测试开始的速度就越快。

Alternatively you can run your tests in the solutions out folder, by disabling "deployment". But I wouldn't do it. Or you can try to copy it yourself, for instance in a method marked with [AssemblyInitialize]. You get a TestContext, which has the property TestDeploymentDir. If you don't really have to optimize it, don't do it.

或者,您可以通过禁用“部署”在解决方案输出文件夹中运行测试。但我不会这样做。或者您可以尝试自己复制,例如在标有[AssemblyInitialize]的方法中。你得到一个TestContext,它有属性TestDeploymentDir。如果你真的不需要优化它,不要这样做。