| 1 | package PerlActor::Runner; | ||
| 2 | use strict; | ||
| 3 | use base 'PerlActor::Object'; | ||
| 4 | |||
| 5 | use PerlActor::Script; | ||
| 6 | |||
| 7 | #=============================================================================================== | ||
| 8 | # Public Methods | ||
| 9 | #=============================================================================================== | ||
| 10 | |||
| 11 | sub run | ||
| 12 | { | ||
| 13 | my $self = shift; | ||
| 14 | my $test = shift; | ||
| 15 | |||
| 16 | $self->start(); | ||
| 17 | |||
| 18 | open SCRIPT, "$test" | ||
| 19 | or die "cannot open test script file $test: $!\n"; | ||
| 20 | |||
| 21 | my @lines = <SCRIPT>; | ||
| 22 | my $script = new PerlActor::Script("$test"); | ||
| 23 | $script->setListener($self); | ||
| 24 | $script->setLines(@lines); | ||
| 25 | $script->execute(); | ||
| 26 | close SCRIPT; | ||
| 27 | |||
| 28 | $self->end(); | ||
| 29 | |||
| 30 | } | ||
| 31 | |||
| 32 | sub start { } | ||
| 33 | |||
| 34 | sub end { } | ||
| 35 | |||
| 36 | sub scriptStarted { } | ||
| 37 | |||
| 38 | sub scriptEnded { } | ||
| 39 | |||
| 40 | sub scriptAborted { } | ||
| 41 | |||
| 42 | sub scriptPassed { } | ||
| 43 | |||
| 44 | sub scriptFailed { } | ||
| 45 | |||
| 46 | sub commandStarted { } | ||
| 47 | |||
| 48 | sub commandEnded { } | ||
| 49 | |||
| 50 | sub commandAborted { } | ||
| 51 | |||
| 52 | sub commandFailed { } | ||
| 53 | |||
| 54 | sub commandPassed { } | ||
| 55 | |||
| 56 | #=============================================================================================== | ||
| 57 | # Protected Methods - Don't even think about calling these from outside the class. | ||
| 58 | #=============================================================================================== | ||
| 59 | |||
| 60 | # Keep Perl happy. | ||
| 61 | 1; |