1#! /bin/sh
2# test_xi18nc:
3# $1: kundo2_aware_xgettext.sh
4# $2: xgettext
5# $3: msgcat
6# $4: podir
7
8# source the kundo2_aware_xgettext.sh script
9. "$1"
10
11# setup environment variables for kundo2_aware_xgettext.sh
12XGETTEXT_PROGRAM="$2"
13MSGCAT="$3"
14podir="$4"
15
16# get common parameters
17. parameters.sh
18# kundo2_aware_xgettext.sh wants this in one variable
19XGETTEXT="$XGETTEXT_PROGRAM $XGETTEXT_FLAGS"
20
21potfile="test_xi18nc.pot"
22cppfile="test_xi18nc.cpp"
23
24kundo2_aware_xgettext "$potfile" "$cppfile"
25
26# check result
27if test ! -e "$podir/$potfile"; then
28    echo "FAIL: pot file not created"
29    exit 1
30fi
31if test 0 -ne `grep qtundo-format "$podir/$potfile"|wc -l`; then
32    echo "FAIL: there should be 0 qtundo-format strings"
33    exit 2
34fi
35if test 2 -ne `grep "^msgid \"" "$podir/$potfile"|wc -l`; then
36    echo "FAIL: there should be 2 message strings"
37    exit 3
38fi
39
40exit 0
41