diff options
Diffstat (limited to 'tests/assert-deps.sh')
| -rwxr-xr-x | tests/assert-deps.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/assert-deps.sh b/tests/assert-deps.sh new file mode 100755 index 0000000..b125a7c --- /dev/null +++ b/tests/assert-deps.sh @@ -0,0 +1,33 @@ +#!/bin/sh +set -eu + +F="$(mkstemp)" +trap 'rm -f "$F"' EXIT + +awk ' + $0 == "sources.js = \\" { sources = 1; next } + $0 == "tests.js = \\" { tests = 1; next } + sources == 1 && $0 == "" { sources = 2; next } + tests == 1 && $0 == "" { tests = 2; next } + + sources == 1 || tests == 1 { + print $1 + } + + END { + if (sources != 2) { + print "Could not find $(sources.js) in Makefile." \ + > "/dev/stderr" + exit 2 + } + if (tests != 2) { + print "Could not find $(tests.js) in Makefile." \ + > "/dev/stderr" + exit 2 + } + } +' Makefile | LANG=POSIX.UTF-8 sort > "$F" + +find src/*.js tests/js/*.js | + LANG=POSIX.UTF-8 sort | + diff -U10 "$F" - |
