chiark / gitweb /
tests: Test Perdir.sd.mk
[subdirmk.git] / tests / filter / update-expected
1 #!/bin/sh
2 #
3 # Usual approach to updating the expected outputs is
4 #   tests/filter/check
5 #   tests/filter/update-expected
6 #   selectively git-add the things that are right, after inspecting them
7
8 set -e
9 files=$(find tests/filter -name \*.expected.tmp)
10 for f in $files; do
11         perl -pe '
12                 (s/\n//, $stripnl=0) if $stripnl;
13                 next unless /^# doctest starts/../^# doctest ends/;
14                 $_="";
15                 $stripnl=1;
16         ' \
17                 <${f%.expected.tmp}.tmp >${f%.tmp}
18 done