nlalitha has asked for the wisdom of the Perl Monks concerning the following question:

package SptTgtCfg; use strict; $| = 1; require 5.6.1; %SptTgtCfg::Max_Num_Can_Network_Interface = ( "GHS NECV850ESFX3" => 5, "GHS NECV850ESFE3 F3370A" => 1, "GHS NECV850ESFK3 F3384" => 5, "GHS NECV850ESFK3 F3385" => 5, ); %SptTgtCfg::Max_Num_Lin_Network_Interface =( "GHS NECV850ESFX3" => 8, "GHS NECV850ESFE3 F3370A" => 2, "GHS NECV850ESFE3 F3371" => 2, "GHS NECV850ESFK3 F3385" => 8, ); %SptTgtCfg::Max_Num_Of_Interest_Mask = ( CAN11 => 4, CAN29 => 4 ); $SptTgtCfg::Is_Lin_Supported = $TRUE; %SptTgtCfg::Controller_Lookup_Hash = ( FCAN => { Protocol => "CAN", }, UARTD => { Protocol => "LIN", }, ); sub ccheck_tgt_repeated_base_address { my ($base, $ni_name); my (%base_address); foreach $ni_name (@SptIm::Ni_Names) { $base = $SptTgtParser::Target_File_Contents_Hash{NetInterfaceDef} {$ni_name}{Base}; if (exists($base_address{$base})) { &SptUtils::ui_err(3, "Network interface <$ni_name> has same base + " . "address as the base address of the other network interface. +"); next; } $base_address{$base} = $ni_name; next; } } # End of subroutine ccheck_tgt_repeated_base_address 1;

Hi Monks

This is one local package created, i need to test the elements in that package are defined and valid values using "Test::More module.

I gone thorugh the module, but i am unable to check with my package

Please help me to test my package

Replies are listed 'Best First'.
Re: Testing Perl Package
by Anonymous Monk on May 10, 2013 at 06:51 UTC

      I have gone through the modules which mentioned, still i am unable to proceed with my package to test with "Test::more" module

      How to start the testing with my package

        I think the first step would be for you to make statements about what your package is supposed to be or do.

        An example could be the statement "The module compiles".

        A better example would be statements on the meaning of the data in your module. Maybe "Every machine has a positive number of CAN_NETWORK_INTERFACES".

        The second step is then to write programs that check that these statements are true. This is where Test::Tutorial comes in.

        With which of the two steps do you have problems? What are these problems?

        You probably should not.