This fixes the latent test suite bug I recently reported on darcs-users.
I'm not quite sure if the final patch is correct, but based on the
option description, I wouldn't expect darcs to ask for confirmation
when "darcs revert -a" is invoked.
Using the File::Temp module needs Perl 5.6.1. Hopefully, this is okay.
Mon Nov 7 20:49:13 CET 2005 Florian Weimer <[EMAIL PROTECTED]>
* During tests, do not exit silently when a write fails
Mon Nov 7 20:50:45 CET 2005 Florian Weimer <[EMAIL PROTECTED]>
* Check for excess input in test cases
This change also fixes a latent race condition (by adding a call to
waitpid): darcs might not have run to completion when echo_to_darcs
returns.
Mon Nov 7 20:52:37 CET 2005 Florian Weimer <[EMAIL PROTECTED]>
* Fix spurious failure of the revert test case
"darcs revert -a" does not require confirmation.
New patches:
[During tests, do not exit silently when a write fails
Florian Weimer <[EMAIL PROTECTED]>**20051107194913] {
hunk ./tests/lib/perl/Test/Darcs.pm 15
+# Catch SIGPIPE signals. Without this line, Perl dies silently if a
+# write operation to a child process fails.
+$SIG{PIPE} = sub { die "SIGPIPE received -- broken testcase?\n" };
}
[Check for excess input in test cases
Florian Weimer <[EMAIL PROTECTED]>**20051107195045
This change also fixes a latent race condition (by adding a call to
waitpid): darcs might not have run to completion when echo_to_darcs
returns.
] {
hunk ./tests/lib/perl/Test/Darcs.pm 94
+ # This file receives superfluous input not read by darcs.
+ use File::Temp qw/tempfile/;
+ my ($fh, $filename) = tempfile();
+
hunk ./tests/lib/perl/Test/Darcs.pm 100
- open2(*READ, *WRITE, "$darcs $command");
+ my $pid = open2(*READ, *WRITE, "$darcs $command ; cat > $filename");
hunk ./tests/lib/perl/Test/Darcs.pm 108
+ # Wait until the process has finished, to make sure that darcs
+ # and the following cat have run to completion.
+ waitpid $pid, 0;
+
+ my $superfluous = <$fh>;
+ unlink $filename;
+ die "darcs did not read all input\n" if $superfluous;
+
}
[Fix spurious failure of the revert test case
Florian Weimer <[EMAIL PROTECTED]>**20051107195237
"darcs revert -a" does not require confirmation.
] {
hunk ./tests/resolve.pl 55
-like( echo_to_darcs("y","revert -a"), qr/finished/i, 'conflicts reverted');
+like( darcs("revert -a"), qr/finished/i, 'conflicts reverted');
}
Context:
[TAG 1.0.4rc2
David Roundy <[EMAIL PROTECTED]>**20051106121631]
Patch bundle hash:
7dcb91745b8edfd288a9f724eb68e28ad47c7a2c
_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel