diff options
Diffstat (limited to 'tests/assert-uninstall.sh')
-rwxr-xr-x | tests/assert-uninstall.sh | 24 |
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 |