提交 a5dace96 编写于 作者: J Ján Tomko

test-wrap-argv: print diff instead of the incorrectly wrapped file

Commit c9c03ea2 stopped creating an intermediate file during syntax-check
to save on execution time. It also switched to outputting the whole
incorrectly wrapped file instead of a diff needed to fix it.

Feed the newly wrapped file to diff via a pipe.

Note that fixing it by running test-wrap-argv.pl --in-place or
the unit test with VIR_TEST_REGENERATE_OUTPUT is easier.
上级 cc04181a
......@@ -89,7 +89,10 @@ sub rewrap {
my $nl = join('', @lines);
my $ol = join('', @orig_lines);
unless ($nl eq $ol) {
print STDERR $ol;
open DIFF, "| diff -u $file -" or die "cannot run diff: $!";
print DIFF $nl;
close DIFF;
print STDERR "Incorrect line wrapping in $file\n";
print STDERR "Use test-wrap-argv.pl to wrap test data files\n";
return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册