diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/developer-guidelines.sgml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/doc/developer-guidelines.sgml b/doc/developer-guidelines.sgml index 433a3022..3c37e5c1 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> | ||
577 | Tests are the best way of knowing if the plugins work as expected. Please | ||
578 | create and update test cases where possible. | ||
579 | </para> | ||
580 | |||
581 | <para> | ||
582 | To run a test, from the top level directory, run "make test". This will run | ||
583 | all the current tests and report an overall success rate. | ||
584 | </para> | ||
585 | |||
586 | <para> | ||
587 | See the <ulink url="http://tinderbox.altinity.org">Nagios Plugins Tinderbox server</ulink> | ||
588 | for 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 | ||
596 | need 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> | ||
601 | If you want a summary test, run: "cd plugins && perl -MTest::Harness -e 'runtests(@ARGV)' t/check_disk.t". | ||
602 | This runs the test in a summary format. | ||
603 | </para> | ||
604 | |||
605 | <para> | ||
606 | For 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"> | ||
608 | link</ulink> | ||
609 | </para> | ||
610 | |||
611 | </section> | ||
612 | |||
613 | <section><title>Testing the C library functions</title> | ||
614 | <para> | ||
615 | Will be looking at using libtap, which is utilised by the FreeBSD team. The output is | ||
616 | based on perl's TAP (Test Anything Protocol) format, so that Test::Harness will understand | ||
617 | results. 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> |