如何在 Visual Studio 2008 Team System 中部署目录来测试输出文件夹?

发布于 2024-08-05 04:55:35 字数 96 浏览 2 评论 0原文

当打开 LocalTestRun.testrunco​​nfig 文件的部署部分时,我可以选择将哪些文件部署到测试输出文件夹,但我需要将特定文件部署到给定的子文件夹中。怎么做呢?

When open my LocalTestRun.testrunconfig file Deployment section I can choose which files are deployed to the Test output folders, but I need that a specific file to be deployed in a given subfolder. How to do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

妞丶爷亲个 2024-08-12 04:55:35

您可以使用 DeploymentItem 元素的 outputDirectory 属性指定文件或目录的子目录:

<TestRunConfiguration ...>
...
  <Deployment>
    <DeploymentItem filename="%File or Directory to deploy path%" 
                    outputDirectory="%output subdirectory%" />
  • filename 属性可以包含绝对路径或相对路径(到relativepathroot(它是包含测试项目的解决方案的目录)
  • 如果要部署一个目录,则该目录中的所有文件将被复制到目标子目录,但不会复制到目录本身,即:
    将从 Dir1 直接复制文件到 Dir2 下,不会在 Dir2 下创建目录“Dir1”来包含这些文件。
  • outputDirectory 属性包含部署根目录

O_o下的目标子目录

You can specify subdirectories for files or directories using the outputDirectory attribute of the DeploymentItem element:

<TestRunConfiguration ...>
...
  <Deployment>
    <DeploymentItem filename="%File or Directory to deploy path%" 
                    outputDirectory="%output subdirectory%" />
  • filename attribute can contain absolute paths or relative paths(to the RelativePathRoot which is the directory of the solution containing your test project)
  • if you want to deploy a directory, all files in that directory will be copied to the destination subdirectory but not the directory itself, i.e.:
    will copy files from Dir1 directly under Dir2, no directory 'Dir1' will be creaed under Dir2 to contain these files.
  • outputDirectory attribute contains destination subdirectory under the deployment root directory

O_o

栖迟 2024-08-12 04:55:35

我遇到了同样的问题,集成测试依赖于特定文件夹中的文件。我最终在我的一个项目的构建后事件中添加了一个脚本,以使用 xcopy 将文件复制到正确的位置。

I had the same issue, where integration tests where dependent on files being in a specific folder. I ended up adding a script to the post build event of one of my projects to copy in the files to the right location using xcopy.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文