chiark
/
gitweb
/
~ian
/
subdirmk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
README: Update copyright date
[subdirmk.git]
/
tests
/
filter
/
check
diff --git
a/tests/filter/check
b/tests/filter/check
index 09b4196e1d5d6539d41dc2e2b5e56a03fa0a5cff..7c4e6ac6119004bf174d4e20f113acb8859417bf 100755
(executable)
--- a/
tests/filter/check
+++ b/
tests/filter/check
@@
-1,9
+1,38
@@
-#!/bin/sh
+#!/bin/bash
+# subdirmk - part of the test suite
+# Copyright 2019 Mark Wooding
+# Copyright 2019 Ian Jackson
+# SPDX-License-Identifier: LGPL-2.0-or-later
+# There is NO WARRANTY.
+
set -e
set -e
+set -o pipefail
cd tests/filter
cd tests/filter
-../../generate
+
+expand <../../README | ./extract-doctests . >/dev/null
+
+set +e
+../../generate sub/dir 2>stderr.tmp
+rc=$?
+set -e
+if [ $rc != 0 ]; then cat stderr.tmp; exit 1; fi
+
+ok=true
+
files=$(find -name \*.expected)
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%/*}/doctests.mk.part"'
+ a
+ }
+ '
+ diff -u $f.tmp ${f%.expected}.tmp || ok=false
+done
+
+$ok
echo ok.
echo ok.