summaryrefslogtreecommitdiff
path: root/tests/assert-uninstall.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/assert-uninstall.sh')
-rwxr-xr-xtests/assert-uninstall.sh24
1 files changed, 24 insertions, 0 deletions
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