#!/usr/bin/env perl use strict; use warnings; # Assemble expected output for check-greplint target. # Usage: greplint-cat.pl ... # # For each , reads greplint/.expect and # prepends "greplint/.test:" to every non-empty line, # matching the output format of greplint.pl. Writes combined # expected output to /expect. my $outdir = shift; open(my $expect, '>', "$outdir/expect") or die "unable to open $outdir/expect: $!"; for my $name (@ARGV) { open(my $fh, '<', "greplint/$name.expect") or die "unable to open greplint/$name.expect: $!"; while (<$fh>) { print $expect "greplint/$name.test:$_"; } close $fh; } close $expect;