xUnit.net测试剥线[取出嵌入的二进制文件的测试代码部署前/运费] [英] xUnit.net Test Stripper [to remove test code embedded in binaries prior to deployment/shipping]

查看:272
本文介绍了xUnit.net测试剥线[取出嵌入的二进制文件的测试代码部署前/运费]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个测试剥(如的xUnit测试模式的)提供支持去除含标记为[事实] S等,再加上从二进制文件上xunit.dll依赖方法的类[作为构建过程的一部分]

Is there a Test Stripper (as defined in xUnit Test Patterns) available that supports removing classes containing methods tagged as [Fact]s etc. plus the dependency on xunit.dll from binaries [as part of a build process] ?

完整的进一步细节要求和环境都在这个CodePlex上的xUnit帖子

Further details of the full requirements and context are at this xUnit CodePlex post.

如果做不到这一点(的东西,删除的测试和参考DLL),没有任何人有一个实用工具/经过考验的清洁方法,无的.vcproj太胡闹周围取出xunit.dll dependecy文件等。

Failing that (something that removes the tests and the reference to the DLL), does anyone have a utility/proven clean approach to removing the xunit.dll dependecy without too much monkeying around in .vcproj files etc.

开源首选。 ,一个干净的书面一个NUnit的可能潜在地作为基地

Open source preferred. A cleanly written one for NUnit might potentially serve as a base.

注:我知道代码嵌入到组件的底片 - 这个心不是问题是(除非你觉得阅读CodePlex上线,一些关键点被错过后)。

推荐答案

如前所述在我规定的要求的 CodePlex网站后,我实现了一个基本的脱衣舞娘与Mono.Cecil能做到,但最终撬动事实未使用的引用中得到了优化一个发布版本以条通过的排除这些基础上的#define,我通过调用的MSBuild

As noted in the codeplex post where I specified the requirements, I implemented a basic stripper with Mono.Cecil but ended up leveraging the fact that unused references get optimised out in a release build to 'strip' tests out by excluding them based on a #define, which I control from outside via the MSBuild invocation

这篇关于xUnit.net测试剥线[取出嵌入的二进制文件的测试代码部署前/运费]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆