Runs pre-configured test scripts or programs : Test « System Functions « Perl






Runs pre-configured test scripts or programs

      

#!/usr/bin/perl -w

use Test::Harness;

@tests = ( 'test1.pl', 'test2.pl');

$Test::Harness::verbose = 1;
Test::Harness::runtests(@tests);



#File: test1.pl
#!/usr/bin/perl -w
print STDERR "\n Running networking test.\n";
print "ok 1\n";

    
#File: test2.pl
#!/usr/bin/perl -w
print "1..5\n";
print STDERR "\n Running performance test.\n";
print "not ok 2\n";
print STDERR "\n Failed database load speed test.\n";
print "not ok 4\n";
print STDERR "\n Failed speed test.\n";

    
    
    
    
  








Related examples in the same category