chiark
/
gitweb
/
~ian
/
subdirmk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests/filter: Test Final.sd.mk
[subdirmk.git]
/
tests
/
filter
/
update-expected
diff --git
a/tests/filter/update-expected
b/tests/filter/update-expected
index ff105423fa427ffe1d68836c36fe76735f4fb9f9..18c53cff4cfdf15d6f925f0b6cf55d4151e6c970 100755
(executable)
--- a/
tests/filter/update-expected
+++ b/
tests/filter/update-expected
@@
-6,5
+6,13
@@
# selectively git-add the things that are right, after inspecting them
set -e
# selectively git-add the things that are right, after inspecting them
set -e
-files=$(find tests/filter -name \*.tmp)
-for f in $files; do cp $f ${f%.tmp}.expected; done
+files=$(find tests/filter -name \*.expected.tmp)
+for f in $files; do
+ perl -pe '
+ (s/\n//, $stripnl=0) if $stripnl;
+ next unless /^# doctest starts/../^# doctest ends/;
+ $_="";
+ $stripnl=1;
+ ' \
+ <${f%.expected.tmp}.tmp >${f%.tmp}
+done