Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-c-8
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test recognition of ISO C 99 <inttypes.h> format string directives.
5
6 cat <<EOF > xg-c-8.c
7 void foo ()
8 {
9   printf (_("File size is: %" PRId64), size);
10   printf (_("File age is %10" PRIdMAX " microseconds"), age);
11   printf (_(PRIXFAST16 " errors"), nerrs);
12   printf (_(PRIXFAT16 " mistakes"), nerrs);
13 }
14 EOF
15
16 : ${XGETTEXT=xgettext}
17 ${XGETTEXT} --omit-header --no-location -k_ -o xg-c-8.tmp xg-c-8.c || exit 1
18 LC_ALL=C tr -d '\r' < xg-c-8.tmp > xg-c-8.po || exit 1
19
20 cat <<EOF > xg-c-8.ok
21 #, c-format
22 msgid "File size is: %<PRId64>"
23 msgstr ""
24
25 #, c-format
26 msgid "File age is %10<PRIdMAX> microseconds"
27 msgstr ""
28
29 #, c-format
30 msgid "<PRIXFAST16> errors"
31 msgstr ""
32
33 #, c-format
34 msgid " mistakes"
35 msgstr ""
36 EOF
37
38 : ${DIFF=diff}
39 ${DIFF} xg-c-8.ok xg-c-8.po
40 result=$?
41
42 exit $result