• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# Copyright (C) 2005 Hans Ulrich Niedermann <gp@n-dimensional.de>
3# SPDX-License-Identifier: LGPL-2.0-or-later
4
5top_builddir="@top_builddir@"
6localedir="@localedir@"
7
8destdir="$(pwd)/tmp-root"
9
10if test -d "${top_builddir}"; then :; else
11    echo "top_builddir \`${top_builddir}' not found"
12    exit 3
13fi
14
15echo -n "Test installation of translated messages..."
16if (cd "${top_builddir}/po" && make DESTDIR="${destdir}" install > /dev/null 2>&1); then
17    echo " done."
18else
19    echo " FAILED."
20    echo "Could not create test installation of translated messages"
21    exit 2
22fi
23
24binlocaledir="$(./print-localedir)"
25mylocaledir="${destdir}${binlocaledir}"
26if test -d "${destdir}${binlocaledir}"; then
27    echo "Test installation contains localedir \`${binlocaledir}'."
28else
29    echo "localedir \`${binlocaledir}' does not exist"
30    exit 1
31fi
32
33testnls="./test-nls ${mylocaledir}"
34if ${testnls}; then
35    echo "NLS test successful"
36    rm -rf "${destdir}"
37    exit 0
38else
39    echo "NLS test failed, not removing test installation from"
40    echo "    ${destdir}"
41    exit 1
42fi
43