Hello!
On Wed, Jun 18, 2014 at 5:21 PM, mallya16 wrote:
> How do you actually call a specific method to run before the tests execute ?
>
> If my module had a function foo(), how can i call it in my test_foo.t file ?
>
Test::Nginx is not a C-function-level unit testing framework. Rather,
it runs the whole nginx with your custom nginx configurations.
C-function-level unit testing is seldom useful in the nginx world due
to various dependencies IMHO.
So you need to expose your C function's functionalities at least to
the configuration level. Alternatively you can use Lua to call into
your C function via FFI via the ngx_lua module. It is up to you.
Check out the existing real world test suites based on Test::Nginx for
ngx_echo, ngx_lua, ngx_drizzle, ngx_postgres, and many other nginx C
modules and those lua-resty-* libraries.
BTW, it is required to *join* the list before posting.
Regards,
-agentzh