diff options
-rw-r--r-- | Makefile | 7 | ||||
-rwxr-xr-x | tests/assert-install.sh | 14 | ||||
-rwxr-xr-x | tests/assert-uninstall.sh | 24 |
3 files changed, 28 insertions, 17 deletions
@@ -109,9 +109,10 @@ check-t: $(tests.js-t) assert-tests = \ - tests/assert-clean.sh \ - tests/assert-deps.sh \ - tests/assert-install.sh \ + tests/assert-clean.sh \ + tests/assert-deps.sh \ + tests/assert-install.sh \ + tests/assert-uninstall.sh \ $(assert-tests): ALWAYS +sh $@ diff --git a/tests/assert-install.sh b/tests/assert-install.sh index f8c0104..65080df 100755 --- a/tests/assert-install.sh +++ b/tests/assert-install.sh @@ -21,18 +21,4 @@ NODE_PATH="$D/usr/lib/node:$NODE_PATH" "$(yellow "$0")" papo -V | grep -q '^papo ' printf ' %s\n' "$(green 'OK')" - - make -s DESTDIR="$D" uninstall - printf '%s: that the "uninstall" target removes everything...' \ - "$(yellow "$0")" - if [ "$(find "$D" -not -type d | wc -l)" != 0 ]; then - printf ' ERR.\n' - cat <<-EOF - Leftover files not removed by "make uninstall": - - $(find "$D" -not -type d) - EOF - exit 1 - fi - printf ' %s\n' "$(green 'OK')" } >&2 diff --git a/tests/assert-uninstall.sh b/tests/assert-uninstall.sh new file mode 100755 index 0000000..82fc86f --- /dev/null +++ b/tests/assert-uninstall.sh @@ -0,0 +1,24 @@ +#!/bin/sh +set -eu + +. tools/lib.sh + +D="$(mkdtemp)" +trap 'rm -rf "$D"' EXIT + +{ + make -s DESTDIR="$D" install + make -s DESTDIR="$D" uninstall + printf '%s: that the "uninstall" target removes everything...' \ + "$(yellow "$0")" + if [ "$(find "$D" -not -type d | wc -l)" != 0 ]; then + printf ' ERR.\n' + cat <<-EOF + Leftover files not removed by "make uninstall": + + $(find "$D" -not -type d) + EOF + exit 1 + fi + printf ' %s\n' "$(green 'OK')" +} >&2 |