1#! /bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test C++ support: test --flag that introduces qt-format.
5
6cat <<\EOF > xg-c-format-3.cc
7foo (gettext ("on"));
8tr ("stopped");
9tr ("action", "");
10tr ("deleted %n files", "", numdel);
11EOF
12
13: ${XGETTEXT=xgettext}
14${XGETTEXT} --omit-header --no-location -d xg-c-format-3.tmp \
15  --qt \
16  --flag=foo:1:qt-format --flag=gettext:1:pass-qt-format \
17  --keyword=tr:1,1t --keyword=tr:1,2c,2t --keyword=tr:1,1,2c,3t \
18  xg-c-format-3.cc || Exit 1
19LC_ALL=C tr -d '\r' < xg-c-format-3.tmp.po > xg-c-format-3.po || Exit 1
20
21cat <<EOF > xg-c-format-3.ok
22#, qt-format
23msgid "on"
24msgstr ""
25
26msgid "stopped"
27msgstr ""
28
29msgctxt ""
30msgid "action"
31msgstr ""
32
33#, qt-plural-format
34msgctxt ""
35msgid "deleted %n files"
36msgid_plural "deleted %n files"
37msgstr[0] ""
38msgstr[1] ""
39EOF
40
41: ${DIFF=diff}
42${DIFF} xg-c-format-3.ok xg-c-format-3.po
43result=$?
44
45exit $result
46