Libtap to include in Nagios code

Ton Voon ton.voon at opsera.com
Fri May 22 10:28:35 CEST 2009


On 19 May 2009, at 23:54, Andreas Ericsson wrote:

> Go right ahead imo.

OK, libtap is now included. I've updated the developer documentation  
so that it includes general information about testing and how it all  
fits together:
   http://community.nagios.org/wiki/index.php/Developer_Guidelines#Testing

As an example, I've added in testing for the logging.c:rotate_log_file  
subroutine in t-tap/test_logging.c. I've also merged in a patch from  
the Opsview version of Nagios where the nagios.log file is recreated  
after a rotate and is given the same permissions as the existing  
nagios.log (required in Opsview due to security reasons). The last  
test in test_logging.c fails before the patch, but now works correctly  
with the patch.

Take a look at test_logging.c for how to write tests and how to pass  
dummy data in and checking for correctness.

As of now, running "make test" does 47 tests which all pass. And only  
takes 1.5s on my macbook to run. Hooray!

Can I encourage all developers and all patch submitters to include  
test cases with their changes to beef up the testing.

Let me know if there are any problems because I am super keen on  
adding more testing into Nagios.

Ton

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20090522/3279162f/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list