Object::Exercise

Generic execution & benchmark harness for method calls
Download

Object::Exercise Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Steven Lembark
  • Publisher web site:
  • http://search.cpan.org/~lembark/

Object::Exercise Tags


Object::Exercise Description

Generic execution & benchmark harness for method calls Object::Exercise is a Perl module that exports a single subroutine, $exercise, which functions as an OO execution loop (see '-n' for changing the installed name).$execute is a subroutine reference that takes an object and set of operations. The first element in that list is an object of the class being tested. The remaining elements are a list of operations, each of which is an array reference.Each operation consists of a method call and the method's arguments. Each method call is dispatched using the object, optionally comparing the return value to some pre-defined result.Exceptions are trapped and logged. The last operation can be re-executed if it fails.All operations are passed in as arrayrefs. They can be nested either to store a return value and test to run, or to hold a list consisting of a method name and its arguments.SYNOPSIS use Object::Exercise; my @operationz = ( # method and arguments , # expected value ], , # continue on failure [], ], , # $obj->$coderef( @argz ) , # expected value 'Coderef returns list' # hardwired message ] ); # You can push the operations through an class: $exercise->( 'YourClass', @test_opz ); # YourClass->method( @argz ) # or an object: my $object = YourClass->new( @whatever ); $exercise->( $object, @test_opz ); # $object->method( @argz ) Requirements: · Perl


Object::Exercise Related Software