简体   繁体   English

在源更改后自动运行测试

[英]run tests automatically after sources changed

I use Cxxtest for unit-testing my C++ code. 我使用Cxxtest对我的C ++代码进行单元测试。 I would like that each time I change and save my code, tests are run (simply, by make tests ). 我希望每次更改并保存我的代码时,都会运行测试(简单地说,通过make tests )。 I know that for Python there is Nosy that enables that. 我知道对于Python来说,有诺西可以实现这一点。 Is there some generic program that would allow this for Cxxtest or any other testing unit? 是否有一些通用程序允许Cxxtest或任何其他测试单元?

Simply, I just need running a single command of files` change. 简单地说,我只需要运行一个文件更改命令。 It wouldn't be difficult to write script like that, but maybe there is some tool already : ) 编写这样的脚本并不困难,但也许已经有了一些工具:)

在Linux上,您可以使用文件系统监视守护程序(如incron )在每次在目录中更改文件时运行命令(例如make tests )(所谓的IN_CLOSE_WRITE事件)。

You could use TeamCity for this. 您可以使用TeamCity。 It can monitor your code repository and run automated builds + unit tests when changes are detected.. Includes a decent web style interface and emailing capability to notify of build/test failures.. 它可以监控您的代码存储库,并在检测到更改时运行自动构建+单元测试。包括一个体面的Web样式界面和电子邮件功能,以通知构建/测试失败..

It can also be configured for both windows and linux builds.. 它也可以配置为windows和linux版本..

http://www.jetbrains.com/teamcity/ http://www.jetbrains.com/teamcity/

If thats a bit heavyweight for you, then you should be able to configure your build process to run the tests for you (eg edit your makefile on linux), but obviously this would still mean you manually kicking off a build when you make changes (which I guess you'd probably do anyway).. 如果你有点重量级,那么你应该能够配置你的构建过程来为你运行测试(例如在linux上编辑你的makefile),但显然这仍然意味着你在进行更改时手动启动构建(我想你可能还是会这样做的..)

Annoyed that there is no ready and simple solution, i just created a simple tool: changerun to run commands when files' change. 我很生气 ,没有现成的简单解决方案,我只是创建了一个简单的工具: changerun在文件更改时运行命令。 I hope someone will find it useful : ) 我希望有人会发现它很有用:)

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

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