interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / greplint-cat.pl

27 lines · 700 bytes Raw Blame History
1#!/usr/bin/env perl
2
3use strict;
4use warnings;
5
6# Assemble expected output for check-greplint target.
7# Usage: greplint-cat.pl <outdir> <test-name> ...
8#
9# For each <test-name>, reads greplint/<test-name>.expect and
10# prepends "greplint/<test-name>.test:" to every non-empty line,
11# matching the output format of greplint.pl. Writes combined
12# expected output to <outdir>/expect.
13
14my $outdir = shift;
15open(my $expect, '>', "$outdir/expect")
16 or die "unable to open $outdir/expect: $!";
17
18for my $name (@ARGV) {
19 open(my $fh, '<', "greplint/$name.expect")
20 or die "unable to open greplint/$name.expect: $!";
21 while (<$fh>) {
22 print $expect "greplint/$name.test:$_";
23 }
24 close $fh;
25}
26
27close $expect;