summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/developer-guidelines.sgml47
1 files changed, 47 insertions, 0 deletions
diff --git a/doc/developer-guidelines.sgml b/doc/developer-guidelines.sgml
index 433a302..3c37e5c 100644
--- a/doc/developer-guidelines.sgml
+++ b/doc/developer-guidelines.sgml
@@ -572,6 +572,53 @@
572 </section> 572 </section>
573</section> 573</section>
574 574
575<section id="Testcases"><title>Test cases</title>
576<para>
577Tests are the best way of knowing if the plugins work as expected. Please
578create and update test cases where possible.
579</para>
580
581<para>
582To run a test, from the top level directory, run "make test". This will run
583all the current tests and report an overall success rate.
584</para>
585
586<para>
587See the <ulink url="http://tinderbox.altinity.org">Nagios Plugins Tinderbox server</ulink>
588for the daily test results.
589</para>
590
591<section><title>Test cases for plugins</title>
592<para>These use perl's Test::More. To do a one time test, run "cd plugins && perl t/check_disk.t".
593</para>
594
595<para>There will somtimes be failures seen in this output which are known failures that
596need to be fixed. As long as the return code is 0, it will be reported as "test pass".
597(If you have a fix so that the specific test passes, that will be gratefully received!)
598</para>
599
600<para>
601If you want a summary test, run: "cd plugins && perl -MTest::Harness -e 'runtests(@ARGV)' t/check_disk.t".
602This runs the test in a summary format.
603</para>
604
605<para>
606For a good and amusing tutorial on using Test::More, see this
607<ulink url="http://search.cpan.org/~mschwern/Test-Simple-0.62/lib/Test/Tutorial.pod">
608link</ulink>
609</para>
610
611</section>
612
613<section><title>Testing the C library functions</title>
614<para>
615Will be looking at using libtap, which is utilised by the FreeBSD team. The output is
616based on perl's TAP (Test Anything Protocol) format, so that Test::Harness will understand
617results. This is still in planning stages.
618</para>
619</section>
620
621</section>
575<section id="CodingGuidelines"><title>Coding guidelines</title> 622<section id="CodingGuidelines"><title>Coding guidelines</title>
576 <para>See <ulink url="http://www.gnu.org/prep/standards_toc.html">GNU 623 <para>See <ulink url="http://www.gnu.org/prep/standards_toc.html">GNU
577 Coding standards</ulink> for general guidelines.</para> 624 Coding standards</ulink> for general guidelines.</para>