简体   繁体   English

TFS / MSBuild通用测试-如何指定项目相对路径

[英]TFS/MSBuild Generic test - how to specify project-relative path

I'm trying to get Silverlight unit tests integrated into a TFS build using a " Generic Test " on a test project to wrap Statlight 我正在尝试在测试项目上使用“ 通用测试 ”将Silverlight单元测试集成到TFS构建中,以包装Statlight

When I hard code the paths to everything it works fine but I'm tearing my hair out trying to work out how to pass project-relative paths to the generic test so that it works in the TFS build environment. 当我对所有内容的路径进行硬编码时,它可以正常工作,但是我想尽办法确定如何将项目相对路径传递给通用测试,以便它可以在TFS构建环境中使用。

The closest I've come is to have the build process workflow set environment variables pointing to StatLight and the xap files containing the SL unit tests so that I can reference those in the command line arguments to statlight. 我最接近的是让构建过程工作流设置指向StatLight的环境变量和包含SL单元测试的xap文件,以便我可以在命令行参数中将这些变量引用到statlight。

Feels hacky though - is there a better way of getting path information into generic tests based on the current solution/build configuration? 但是,您会感到有些疑惑-是否有更好的方法将路径信息纳入基于当前解决方案/构建配置的通用测试中?

The MSDN documentation uses a couple of environment variables ( %TestDeploymentDir% for one) that I can't find documented anywhere so I'm wondering if there are any more magic variables that I can use to infer paths from rather than having to set my own. MSDN文档使用了几个环境变量(其中一个为%TestDeploymentDir% ),我在任何地方都找不到文档,因此我想知道是否还有更多魔术变量可以用来推断路径,而不必设置我的环境变量。拥有。

Here are some references on MSBuild properties: 这是有关MSBuild属性的一些参考:

Hope that helps. 希望能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM