summaryrefslogtreecommitdiff
path: root/test/nls/check-nls.in
diff options
context:
space:
mode:
Diffstat (limited to 'test/nls/check-nls.in')
-rw-r--r--test/nls/check-nls.in40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/nls/check-nls.in b/test/nls/check-nls.in
new file mode 100644
index 0000000..f484940
--- /dev/null
+++ b/test/nls/check-nls.in
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+top_builddir="@top_builddir@"
+localedir="@localedir@"
+
+destdir="$(pwd)/tmp-root"
+
+if test -d "${top_builddir}"; then :; else
+ echo "top_builddir \`${top_builddir}' not found"
+ exit 3
+fi
+
+echo -n "Test installation of translated messages..."
+if (cd "${top_builddir}/po" && make DESTDIR="${destdir}" install > /dev/null 2>&1); then
+ echo " done."
+else
+ echo " FAILED."
+ echo "Could not create test installation of translated messages"
+ exit 2
+fi
+
+binlocaledir="$(./print-localedir)"
+mylocaledir="${destdir}${binlocaledir}"
+if test -d "${destdir}${binlocaledir}"; then
+ echo "Test installation contains localedir \`${binlocaledir}'."
+else
+ echo "localedir \`${binlocaledir}' does not exist"
+ exit 1
+fi
+
+testnls="./test-nls ${mylocaledir}"
+if ${testnls}; then
+ echo "NLS test successful"
+ rm -rf "${destdir}"
+ exit 0
+else
+ echo "NLS test failed, not removing test installation from"
+ echo " ${destdir}"
+ exit 1
+fi