Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

test::autoloader(3pm) [debian man page]

AutoLoader(3pm) 					User Contributed Perl Documentation					   AutoLoader(3pm)

NAME
Test::AutoLoader - a testing utility for autosplit/autoloaded modules. SYNOPSIS
use Test::AutoLoader; use Test::More tests => 3; use_ok("My::Module"); # from Test::More autoload_ok("My::Module","mysub","sub_two); # test only the listed subs autoload_ok("My::Module"); # tests all '.al' files found for the module DESCRIPTION
This single-purpose module attempts to eliminate uncaught syntax errors or other obvious goofs in subroutines that are autosplit, and hence not looked at by "perl -c Module.pm". Ideally, this module will become unnecessary as you reach full coverage of those subroutines in your unit tests. Until that happy day, however, this should provide a quick and dirty backstop for embarrassing typos. Test::AutoLoader is built on Test::Builder, and should interoperate smoothly with other such modules (e.g. Test::Simple, Test::More). EXPORT
autoload_ok Very much like the 'use_ok' subroutine (see Test::More). If passed only a module name, it will find all subroutine definitions in the "auto" directory and attempt to compile them. If passed a list of subroutine names, it will look for and attempt to compile those (and only those). Any files that cannot be found (if specified directly), read, and compiled will be listed in the diagnostic output for the failed test. AUTHOR
Ben Warfield (ben_warfield@nrgn.com) COPYRIGHT AND LICENSE
This module is copyright (c) 2005 Neurogen Corporation, Branford, Connecticut, USA. It may be distributed under the terms of the GNU General Public License. SEE ALSO
perl, Test::More, AutoLoader. perl v5.10.1 2005-07-22 AutoLoader(3pm)

Check Out this Related Man Page

Test::use::ok(3)					User Contributed Perl Documentation					  Test::use::ok(3)

NAME
Test::use::ok - Alternative to Test::More::use_ok SYNOPSIS
use ok 'Some::Module'; DESCRIPTION
According to the Test::More documentation, it is recommended to run "use_ok()" inside a "BEGIN" block, so functions are exported at compile-time and prototypes are properly honored. That is, instead of writing this: use_ok( 'Some::Module' ); use_ok( 'Other::Module' ); One should write this: BEGIN { use_ok( 'Some::Module' ); } BEGIN { use_ok( 'Other::Module' ); } However, people often either forget to add "BEGIN", or mistakenly group "use_ok" with other tests in a single "BEGIN" block, which can create subtle differences in execution order. With this module, simply change all "use_ok" in test scripts to "use ok", and they will be executed at "BEGIN" time. The explicit space after "use" makes it clear that this is a single compile-time action. SEE ALSO
Test::More CC0 1.0 Universal To the extent possible under law, XX has waived all copyright and related or neighboring rights to Test-use-ok. This work is published from Taiwan. <http://creativecommons.org/publicdomain/zero/1.0> POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 45: Non-ASCII character seen before =encoding in 'XX'. Assuming UTF-8 perl v5.18.2 2012-09-11 Test::use::ok(3)
Man Page

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl: FH and multiple writes

I found this logging subroutine on the net that I want to use but despite trying many things, I cannot figure out how to get the date in front of the logged text. Ideally what I'm looking for is a line that looks something like this: Wed Aug 20 18:17:29 PDT 2008 - my logging info here. my... (2 Replies)
Discussion started by: gctaylor
2 Replies

2. Shell Programming and Scripting

Shell - How to iterate through all the files in a directory?

Hi, I have a directory call Test, which contains files "a", b", "c", etc. I want to go through all of the files inside Test and remove any empty file. How would I do that with shell csh? So far I got... #!/bin/csh if (($#argv == 0) || ($#argv > 1)) then echo "no argument or too... (2 Replies)
Discussion started by: teiji
2 Replies

3. Shell Programming and Scripting

calling perl subroutine from perl expect module

All, Is it possible to call a subroutine from the perl expect module after logging to a system that is within the same program. My situation is I need to run a logic inside a machine that I'm logging in using the expect module, the logic is also available in the same expect program. Thanks,... (5 Replies)
Discussion started by: arun_maffy
5 Replies

4. Programming

perl: Subroutine question

Hi everyone, I have given up finally trying to find a way to do this. I have a subroutine called LoginFirst where I am starting a new SSH session. I have bunch of subroutines, each one of them uses a (or I have to create a new SSH constructor everytime) ssh connection to get some value so ... (2 Replies)
Discussion started by: dummy_code
2 Replies