Revision: 1218
Author: [email protected]
Date: Fri May  7 01:55:10 2010
Log: Tweak to be more likely to get a diff from test errors on windows
(eg http://www.cpantesters.org/cpan/report/7210232 )

http://code.google.com/p/perl-devel-nytprof/source/detail?r=1218

Modified:
 /trunk/t/lib/NYTProfTest.pm

=======================================
--- /trunk/t/lib/NYTProfTest.pm Tue May  4 03:47:24 2010
+++ /trunk/t/lib/NYTProfTest.pm Fri May  7 01:55:10 2010
@@ -23,9 +23,7 @@
 use Devel::NYTProf::Util qw(strip_prefix_from_paths html_safe_filename);
 use Devel::NYTProf::Run qw(perl_command_words);

-
-my $this_perl = $^X;
-$this_perl .= $Config{_exe} if $^O ne 'VMS' and $this_perl !~ m/$Config{_exe}$/i;
+my $diff_opts = ($Config{osname} eq 'MSWin32') ? '-c' : '-u';

 my %opts = (
     one          => $ENV{NYTPROF_TEST_ONE},
@@ -417,14 +415,12 @@
     );
     return;
 }
-

 sub diff_files {
     my ($old_file, $new_file, $newp_file) = @_;

     # we don't care if this fails, it's just an aid to debug test failures
-    my @opts = split / /, $ENV{NYTPROF_DIFF_OPTS} || '';    # e.g. '-y'
-    @opts = ('-u') unless @opts;
+ my @opts = split / /, $ENV{NYTPROF_DIFF_OPTS} || $diff_opts; # e.g. '-y' system("cmp -s $new_file $newp_file || diff @opts $old_file $new_file 1>&2");
 }

--
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