summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile20
-rwxr-xr-xtests/assert-deps.sh33
2 files changed, 46 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index beb18b1..faa4c51 100644
--- a/Makefile
+++ b/Makefile
@@ -47,15 +47,13 @@ manpages.in = $(manpages.en.in)
manpages = $(manpages.in:.in=)
sources.js = \
- src/compat.js \
- src/utils.js \
- src/server/web.js \
- src/client.js \
+ src/api.js \
+ src/cli.js \
+ src/utils.js \
tests.js = \
tests/js/compat.js \
tests/js/utils.js \
- tests/js/server/web.js \
sources = \
@@ -84,11 +82,19 @@ $(tests.js-t):
check-t: $(tests.js-t)
+assert-tests = \
+ tests/assert-deps.sh \
+
+$(assert-tests): ALWAYS
+ sh $@
+
+check-asserts: $(assert-tests)
+
## Run all tests. Each test suite is isolated, so that a parallel
## build can run tests at the same time. The required artifacts
-## are created if required.
-check: check-t
+## are created if missing.
+check: check-t check-asserts
## Remove *all* derived artifacts produced during the build.
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" -