Thread: [srvx-commits] CVS: services/tests test-driver.pl,1.2,1.3
Brought to you by:
entrope
From: Entrope <en...@us...> - 2003-09-26 22:04:26
|
Update of /cvsroot/srvx/services/tests In directory sc8-pr-cvs1:/tmp/cvs-serv18891/tests Modified Files: test-driver.pl Log Message: add support for a lot more events, and fix behavior for some unusual cases Index: test-driver.pl =================================================================== RCS file: /cvsroot/srvx/services/tests/test-driver.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** test-driver.pl 6 May 2002 23:33:11 -0000 1.2 --- test-driver.pl 26 Sep 2003 22:04:12 -0000 1.3 *************** *** 6,10 **** # want to stop. ! require 5.6.0; use warnings; --- 6,10 ---- # want to stop. ! require 5.006; use warnings; *************** *** 36,41 **** _start => \&drv_start, _child => sub {}, ! _signal => sub {}, ! _stop => sub { print "That's all, folks!\n"; }, _default => \&drv_default, # generic utilities or miscellaneous functions --- 36,40 ---- _start => \&drv_start, _child => sub {}, ! _stop => sub { print "\nThat's all, folks!\n"; }, _default => \&drv_default, # generic utilities or miscellaneous functions *************** *** 52,55 **** --- 51,55 ---- cmd_nick => \&cmd_generic, cmd_notice => \&cmd_message, + cmd_part => \&cmd_generic, cmd_privmsg => \&cmd_message, cmd_quit => \&cmd_generic, *************** *** 63,71 **** irc_msg => \&irc_msg, # PRIVMSG to self irc_public => \&irc_public, # PRIVMSG to channel irc_join => sub {}, irc_mode => sub {}, ! irc_quit => sub {}, ! irc_connected => sub {}, irc_ping => sub {}, irc_error => \&irc_error, irc_disconnected => \&irc_disconnected, --- 63,82 ---- irc_msg => \&irc_msg, # PRIVMSG to self irc_public => \&irc_public, # PRIVMSG to channel + irc_connected => sub {}, + irc_ctcp_action => sub {}, + irc_ctcp_ping => sub {}, + irc_ctcp_time => sub {}, + irc_ctcpreply_ping => sub {}, + irc_ctcpreply_time => sub {}, + irc_invite => sub {}, irc_join => sub {}, + irc_kick => sub {}, + irc_kill => sub {}, irc_mode => sub {}, ! irc_nick => sub {}, ! irc_part => sub {}, irc_ping => sub {}, + irc_quit => sub {}, + irc_topic => sub {}, irc_error => \&irc_error, irc_disconnected => \&irc_disconnected, *************** *** 73,76 **** --- 84,88 ---- args => [@ARGV]); + $| = 1; $poe_kernel->run(); exit; *************** *** 118,121 **** --- 130,134 ---- } elsif (defined($line = <$script>)) { $heap->{lineno} = $.; + print "."; } else { # close all connections *************** *** 136,140 **** # expand any macros in the line ! $line =~ s/(?<=[^\\])%(\S+)%/$heap->{macros}->{$1} or die "Use of undefined macro $1 at $heap->{lineno}"/eg; # remove any \-escapes $line =~ s/\\(.)/$1/g; --- 149,154 ---- # expand any macros in the line ! $line =~ s/(?<=[^\\])%(\S+?)%/$heap->{macros}->{$1} ! or die "Use of undefined macro $1 at $heap->{lineno}\n"/eg; # remove any \-escapes $line =~ s/\\(.)/$1/g; *************** *** 390,394 **** delete $heap->{clients}->{$client->{name}}; } else { ! print "Got unexpected disconnect for $client->{name} (nick $client->{nick})\n"; $kernel->call($session, 'disable_client', $client); $kernel->delay_set('reconnect', $client->{throttled} ? THROTTLED_TIMEOUT : RECONNECT_TIMEOUT, $client); --- 404,412 ---- delete $heap->{clients}->{$client->{name}}; } else { ! if ($client->{disconnect_expected}) { ! delete $client->{disconnect_expected}; ! } else { ! print "Got unexpected disconnect for $client->{name} (nick $client->{nick})\n"; ! } $kernel->call($session, 'disable_client', $client); $kernel->delay_set('reconnect', $client->{throttled} ? THROTTLED_TIMEOUT : RECONNECT_TIMEOUT, $client); *************** *** 448,452 **** my ($kernel, $session, $heap, $sender, $what) = @_[KERNEL, SESSION, HEAP, SENDER, ARG0]; my $client = $heap->{sessions}->{$sender}; ! print "ERROR: From server to $client->{name}: $what\n"; $client->{throttled} = 1 if $what =~ /throttled/i; } --- 466,477 ---- my ($kernel, $session, $heap, $sender, $what) = @_[KERNEL, SESSION, HEAP, SENDER, ARG0]; my $client = $heap->{sessions}->{$sender}; ! if (@{$client->{expect}} ! and $client->{expect}->[0]->[1] =~ /error/i) { ! splice @{$client->{expect}->[0]}, 2, 1; ! unexpect($kernel, $session, $client); ! $client->{disconnect_expected} = 1; ! } else { ! print "ERROR: From server to $client->{name}: $what\n"; ! } $client->{throttled} = 1 if $what =~ /throttled/i; } |