chiark / gitweb /
tests: Test Perdir.sd.mk
[subdirmk.git] / tests / filter / check
index 2a5a8ee..5ba1a23 100755 (executable)
@@ -1,9 +1,23 @@
-#!/bin/sh
+#!/bin/bash
 set -e
+set -o pipefail
 
 cd tests/filter
+
+expand <../../README | ./extract-doctest . >/dev/null
+
 ../../generate sub/dir
 files=$(find -name \*.expected)
-for f in $files; do diff -u $f ${f%.expected}.tmp; done
+for f in $files; do
+       i=$f
+       o=$f.tmp
+       sed <$i >$o '
+               /^# doctests:/ {
+                       r '"${f%/*}/doctest.mk.part"'
+                       a
+               }
+       '
+       diff -u $f.tmp ${f%.expected}.tmp
+done
 
 echo ok.