Permalink
Browse files

add trivial debugging options

  • Loading branch information...
1 parent ab0a791 commit 938d8853b9096c3179f456c8b7a50966355bf33f Andreas J. Koenig committed Mar 19, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 t/31sessions.t
View
16 t/31sessions.t
@@ -21,10 +21,18 @@ use warnings;
our @opt;
BEGIN { @opt = <<'=back' =~ /B<--(\S+)>/g;
+=item B<--debug!>
+
+Noise
+
=item B<--help|h!>
This help
+=item B<--pause!>
+
+After every session make a pause, waiting for an ENTER keypress.
+
=item B<--session=s@>
execute only the session with this name.
@@ -79,6 +87,9 @@ BEGIN {
if ($Opt{session}) {
%limit_to_sessions = map {($_=>1)} @{$Opt{session}};
}
+ if ($Opt{debug}) {
+ require YAML::Syck;
+ }
require local_utils;
local_utils::cleanup_dot_cpan();
@@ -469,6 +480,11 @@ SESSION_RUN: for my $si (0..$#SESSIONS) {
close SYSTEM or mydiag "error while running '$system' on '$session->{name}'";
my $content = do {local *FH; open FH, "test.out" or die; local $/; <FH>};
my(@chunks) = split /$prompt_re/, $content;
+ diag sprintf "DEBUG: All chunks of new session\n%s", YAML::Syck::Dump(@chunks) if $Opt{debug};
+ if ($Opt{pause}) {
+ diag "Press ENTER to continue";
+ <>;
+ }
# shift @chunks;
# warn sprintf "# DEBUG: pairs[%d]chunks[%d]", scalar @{$session->{pairs}}, scalar @chunks;
for (my $i = 0; 2*$i < $#{$session->{pairs}}; $i++) {

0 comments on commit 938d885

Please sign in to comment.