diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-09-28 16:50:26 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-09-28 16:50:26 +0100 |
commit | 3879ea51d63e30f393172fcd711bc89f88997019 (patch) | |
tree | 53e01b81dbbff025a2182461c86ac0dc443aa37e /regen_lib.pl | |
parent | bd6920d7fd435edce8cd45d53f46b2a0ca0f5663 (diff) | |
download | perl-3879ea51d63e30f393172fcd711bc89f88997019.tar.gz |
A test to check that regen.pl doesn't need running.
We can't run regen.pl as part of the build, as we'd end up with a circular
dependency between the headers and miniperl.
Diffstat (limited to 'regen_lib.pl')
-rw-r--r-- | regen_lib.pl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/regen_lib.pl b/regen_lib.pl index 7d396c0447..9008629998 100644 --- a/regen_lib.pl +++ b/regen_lib.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w use strict; -use vars qw($Needs_Write $Verbose @Changed); +use vars qw($Needs_Write $Verbose @Changed $TAP); use File::Compare; use Symbol; @@ -10,6 +10,7 @@ $Needs_Write = $^O eq 'cygwin' || $^O eq 'os2' || $^O eq 'MSWin32'; $Verbose = 0; @ARGV = grep { not($_ eq '-q' and $Verbose = -1) } + grep { not($_ eq '--tap' and $TAP = 1) } grep { not($_ eq '-v' and $Verbose = 1) } @ARGV; END { @@ -42,6 +43,12 @@ sub safer_rename_silent { sub rename_if_different { my ($from, $to) = @_; + if ($TAP) { + my $not = compare($from, $to) ? 'not ' : ''; + print STDOUT $not . "ok - $0 $to\n"; + safer_unlink($from); + return; + } if (compare($from, $to) == 0) { warn "no changes between '$from' & '$to'\n" if $Verbose > 0; safer_unlink($from); |