Author: tim.bunce
Date: Tue Jan 20 05:04:11 2009
New Revision: 674

Modified:
    trunk/t/20.runtests.t

Log:
Make -v option to t/20.runtests.t slightly more useful.


Modified: trunk/t/20.runtests.t
==============================================================================
--- trunk/t/20.runtests.t       (original)
+++ trunk/t/20.runtests.t       Tue Jan 20 05:04:11 2009
@@ -178,19 +178,14 @@

  sub run_command {
      my ($cmd) = @_;
-    print "NYTPROF=$ENV{NYTPROF}\n" if $opts{v} && $ENV{NYTPROF};
+    warn "NYTPROF=$ENV{NYTPROF}\n" if $opts{v} && $ENV{NYTPROF};
      local $ENV{PERL5LIB} = $perl5lib;
-    my $ok;
-    if ($opts{v}) {
-        print "$cmd\n";
-        $ok = (system($cmd) == 0);
-    }
-    else {
-        open(RV, "$cmd |") or die "Can't execute $cmd: $!\n";
-        my @results = <RV>;
-        $ok = close RV;
-    }
-    warn "Error status $? from $cmd\n" if not $ok;
+    warn "$cmd\n" if $opts{v};
+    local *RV;
+    open(RV, "$cmd |") or die "Can't execute $cmd: $!\n";
+    my @results = <RV>;
+    my $ok = close RV;
+    warn "Error status $? from $cmd!\n\n" if not $ok;
      return $ok;
  }

@@ -402,7 +397,7 @@
  sub unlink_old_profile_datafiles {
      my ($filename) = @_;
      my @profile_datafiles = profile_datafiles($filename);
-    warn "Unlinking old @profile_datafiles\n"
+    print "Unlinking old @profile_datafiles\n"
          if @profile_datafiles and $opts{v};
      1 while unlink @profile_datafiles;
  }

--~--~---------~--~----~------------~-------~--~----~
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to