summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile5
-rwxr-xr-xtests/test_install.sh21
2 files changed, 25 insertions, 1 deletions
diff --git a/tests/Makefile b/tests/Makefile
index d4847b1..196426e 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -141,11 +141,14 @@ endif
DD:=dd
-test: test-lz4 test-lz4c test-frametest test-fullbench test-fuzzer
+test: test-lz4 test-lz4c test-frametest test-fullbench test-fuzzer test-install
test32: CFLAGS+=-m32
test32: test
+test-install:
+ lz4_root=.. ./test_install.sh
+
test-lz4-sparse: lz4 datagen
@echo "\n ---- test sparse file support ----"
./datagen -g5M -P100 > tmplsdg5M
diff --git a/tests/test_install.sh b/tests/test_install.sh
new file mode 100755
index 0000000..2e1a5a5
--- /dev/null
+++ b/tests/test_install.sh
@@ -0,0 +1,21 @@
+#/usr/bin/env sh
+set -e
+
+make="make -C $lz4_root"
+$make CFLAGS=-O0 > /dev/null
+for cmd in install uninstall; do
+ for upper in DUMMY PREFIX EXEC_PREFIX LIBDIR INCLUDEDIR PKGCONFIGDIR BINDIR MANDIR MAN1DIR ; do
+ lower=$(echo $upper | tr '[:upper:]' '[:lower:]')
+ tmp_lower="$(pwd)/tmp-lower-$lower/"
+ tmp_upper="$(pwd)/tmp-upper-$lower/"
+ echo $make $cmd DESTDIR="$tmp_upper" $upper="test"
+ $make $cmd DESTDIR="$tmp_upper" $upper="test" >/dev/null
+ echo $make $cmd DESTDIR="$tmp_lower" $lower="test"
+ $make $cmd DESTDIR="$tmp_lower" $lower="test" >/dev/null
+ command diff -r "$tmp_lower" "$tmp_upper" && echo "SAME!" || false
+ if [ "x$cmd" = "xuninstall" ]; then
+ test -z "$(find "$tmp_lower" -type f)" && echo "EMPTY!" || false
+ rm -rf "$tmp_upper" "$tmp_lower"
+ fi
+ done
+done