<div dir="ltr"><div>Hi Maxim, <br></div>How these tests could be run? Do I need something special installed?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 23, 2015 at 2:42 AM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<span class=""><br>
On Sat, Nov 21, 2015 at 09:40:57PM +0000, Ritesh Jha wrote:<br>
<br>
> Hello everyone,<br>
> We are developing nginx modules to implement few usecases in our<br>
> product. Most of the other usecases cases have been implemented<br>
> using Java. At my office we follow TDD for Java development. TDD<br>
> for Java development is easy due to availability of unit-testing<br>
> and mocking frameworks. We are wondering if we can follow TDD<br>
> for development of nginx modules as well. We have tried couple<br>
> of unit-testing frameworks for C (Unity and CMocka) but we have<br>
> found it very difficult to write useful testcases using these<br>
> frameworks.<br>
><br>
> Can you please suggest a suitable approach? Also if unit testing<br>
> is not the way to go, then what should be the approach for<br>
> developing, testing and maintaining large nginx modules?<br>
<br>
</span>We have a test suite we use in nginx development, available here:<br>
<br>
<a href="http://hg.nginx.org/nginx-tests" rel="noreferrer" target="_blank">http://hg.nginx.org/nginx-tests</a><br>
<br>
It was originally written by me for testing both nginx itself and<br>
my modules for nginx.  And example use in a module can be seen<br>
here:<br>
<br>
<a href="http://mdounin.ru/hg/ngx_http_bytes_filter_module/file/57365655ee44/t" rel="noreferrer" target="_blank">http://mdounin.ru/hg/ngx_http_bytes_filter_module/file/57365655ee44/t</a><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Maxim Dounin<br>
<a href="http://nginx.org/" rel="noreferrer" target="_blank">http://nginx.org/</a><br>
<br>
_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br>
</font></span></blockquote></div><br></div>