MSBuild 任务的测试驱动开发
在以测试驱动的方式开发自定义 MSBuild 任务时,您会采取什么方法?
是否有任何可用的测试工具适合测试驱动 Microsoft.Build.Utilities.ToolTask 扩展的开发?
我正在考虑尝试使用 NUnit 或 MSUnit 并检查生成的文件及其放置位置,尽管我预见这有点笨拙。
What approach would you take while developing a custom MSBuild Task in a test driven way?
Are there any available test harnesses suitable for test drive development of a Microsoft.Build.Utilities.ToolTask extension?
I was considering attempting to use NUnit or MSUnit and check files generated and where they are placed, though this I forsee this as being a little clunky.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这不是真正的 TDD 方式,但看看工具 MS Build Sidekicks
这个工具确实帮助我们开发我们的每晚/每日构建(包括数据库创建、结构比较、代码分析、测试执行、clickonce 部署...)
您可以在构建机器和本地开发机器上分析和调试构建类型。
it's not really TDD way but look at the Tool MS Build Sidekicks
This tool really helps us to develop our nightly/daily builds (with database creation, structure compare, CodeAnalysis, test execution, clickonce deployment ...)
You can analyse and debug the build types on the build machine and on the local development machine.
构建脚本不是为了测试而设计的。但是
您可以为构建创建一些 SmokeTest,以查看一切是否正常。如果您正在部署一个网站,您可以进行一些冒烟测试来查看:
打开产品页面或类似的)
这些冒烟测试应该能够从命令行调用,因此您可以从任务 AfterDropBuild 调用它们,以在创建构建后查看冒烟测试的结果。
Build scripts are not designed to be tested.. but
You can create some SmokeTests of your build to see if everything went ok. If you are deploying a website you can have some smoke tests to see:
opening product page or similar)
Those smoke test should be able to be called from command line, so you can call them from task AfterDropBuild to see the result of smoke tests just after build was created.