.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PluginTestCase 3pm" .TH PluginTestCase 3pm 2024-07-12 "Lire 2.1.1" "LogReport's Lire Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Lire::Test::PluginTestCase \- Base class for writing Plugin unit tests .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use base qw/ Lire::Test::PluginTestCase /; \& \& use MyPlugin; \& use File::Basename; \& \& sub create_plugin { \& return new MyPlugin(); \& } \& \& sub registration_file { \& return dirname( _\|_FILE_\|_ ) . "../../plugin_init"; \& } .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This is a Test::Unit::TestCase subclass which can be used to easily write tests for Lire::Plugin. This class implements what is needed to provide the necessary fixture in the \fBset_up()\fR and \fBtear_down()\fR. .PP It provides two base tests: \fBtest_api()\fR and \fBtest_registration_file()\fR. .PP The test class needs to implement two methods to help complete the fixture. .SH FIXTURES .IX Header "FIXTURES" These are the methods that subclasses will usually override to provide the necessary data so that the ChartType test fixtures be setup. .SS \fBregistration_file()\fP .IX Subsection "registration_file()" This should return the script that is responsible for registring the analyser with the Lire::PluginManager. This is used by the default \&\fBtest_registration_file()\fR. .SS \fBproperties_spec_file()\fP .IX Subsection "properties_spec_file()" If this method returns a filename, it will be set as the default configuration spec for the test. Use it when the plugin has properties. .SS \fBcreate_plugin()\fP .IX Subsection "create_plugin()" This should return an instance of the Lire::Plugin instance to test. .SH "DEFAULT TESTS" .IX Header "DEFAULT TESTS" .SS \fBtest_api()\fP .IX Subsection "test_api()" Make sure that all methods required by Lire::Plugin are implemented. .PP It checks that \fBdescription()\fR formats correctly as DocBook. .SS \fBtest_registration_file()\fP .IX Subsection "test_registration_file()" Checks that the registration script correctly registers the analyser with the PluginManager. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBLire::Test::TestCase\fR\|(3pm), \fBLire::Plugin\fR\|(3pm) .SH AUTHOR .IX Header "AUTHOR" Francis J. Lacoste .SH VERSION .IX Header "VERSION" \&\f(CW$Id:\fR PluginTestCase.pm,v 1.2 2006/07/23 13:16:32 vanbaal Exp $ .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (C) 2004 Stichting LogReport Foundation LogReport@LogReport.org .PP This file is part of Lire. .PP Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. .PP You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html.