summaryrefslogtreecommitdiff
path: root/tests/assert-deps.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/assert-deps.sh')
-rwxr-xr-xtests/assert-deps.sh45
1 files changed, 5 insertions, 40 deletions
diff --git a/tests/assert-deps.sh b/tests/assert-deps.sh
index 9bfc5ea..b73933d 100755
--- a/tests/assert-deps.sh
+++ b/tests/assert-deps.sh
@@ -1,45 +1,10 @@
#!/bin/sh
set -eu
-if [ ! -e .git ]; then
- echo "Not in a Git repository, skipping \"$0\"." >&2
- exit
-fi
-
-
. tools/lib.sh
-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"
-
-printf '%s: all JavaScript sources are listed in the Makefile...' \
- "$(yellow "$0")" >&2
-git ls-files src/*.js tests/js/*.js |
- LANG=POSIX.UTF-8 sort |
- diff -U10 "$F" -
-printf ' %s\n' "$(green 'OK')" >&2
+{
+ printf '%s: all deps.mk is up-to-date...' "$(yellow "$0")"
+ sh mkdeps.sh | diff -U10 deps.mk -
+ printf ' %s\n' "$(green 'OK')"
+} >&2