aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lib/Test/Irssi/Driver.pm
diff options
context:
space:
mode:
authorTom Feist <shabble@metavore.org>2011-02-28 00:32:04 +0000
committerTom Feist <shabble@metavore.org>2011-02-28 00:32:04 +0000
commit1063657c9145eed77b9228066488c91880093391 (patch)
tree0c83a09d88e70150bef99c3d301c2b20f714445d /testing/lib/Test/Irssi/Driver.pm
parentrandom checkin, thinks are a bit in flux and about to change greatly so I'm (diff)
downloadirssi-scripts-1063657c9145eed77b9228066488c91880093391.tar.gz
irssi-scripts-1063657c9145eed77b9228066488c91880093391.zip
refactor everything to make tests more test-like.
Diffstat (limited to 'testing/lib/Test/Irssi/Driver.pm')
-rw-r--r--testing/lib/Test/Irssi/Driver.pm40
1 files changed, 22 insertions, 18 deletions
diff --git a/testing/lib/Test/Irssi/Driver.pm b/testing/lib/Test/Irssi/Driver.pm
index 80199ef..3b6000b 100644
--- a/testing/lib/Test/Irssi/Driver.pm
+++ b/testing/lib/Test/Irssi/Driver.pm
@@ -39,6 +39,7 @@ sub START {
InputEvent => "got_terminal_stdin",
Filter => POE::Filter::Stream->new(),
);
+
$self->log("stdio options: " . dump(@stdio_options));
# Start the terminal reader/writer.
@@ -75,7 +76,7 @@ sub STOP {
$self->parent->_logfile_fh->close();
say "\n\n";
- $self->parent->summarise_test_results();
+ #$self->parent->summarise_test_results();
}
### Handle terminal STDIN. Send it to the background program's STDIN.
@@ -161,32 +162,35 @@ sub testing_ready {
# begin by fetching a test from the pending queue.
$self->log("Starting to run tests");
$self->log("-" x 80);
- $self->parent->run_tests();
+ $self->parent->run_test;
+}
+
+sub execute_test {
+ my ($self, $heap, $kernel, $test) = @_[OBJECT,HEAP, KERNEL, ARG0];
+ # do some stuff here to evaluate it.
+
+ $test->evaluate_test;
+
}
-sub testing_complete {
+sub test_complete {
my ($self, $kernel) = @_[OBJECT, KERNEL];
- # make sure all tests have run to completion.
- my $done = 1;
- $self->log("Testing to see if we can quit: ");
- foreach my $test ($self->parent->all_tests) {
- if (not $test->complete) {
- $self->log("\t" . $test->name . " is not complete");
- $done = 0;
- }
- }
- if ($done) {
- $kernel->yield('shutdown');
- } else {
- # ???
- $self->parent->active_test->resume_from_timer;
+
+ $self->parent->complete_test;
+
+ if ($self->parent->tests_remaining) {
+ $self->parent->run_test;
}
+
+ # otherwise, we're done, and can shutdown.
+ #$kernel->yield('shutdown');
+
}
sub timer_created {
my ($self, $heap, $kernel, $duration) = @_[OBJECT, HEAP, KERNEL, ARG0];
$kernel->delay(got_delay => $duration);
- $self->log("Timer created");
+ $self->log("Timer created for $duration");
}
sub timer_expired {