150476Speter#! /bin/sh
27629Sjkh
37629Sjkh# Test C support: comments.
47629Sjkh
57305Sjkhtmpfiles=""
67305Sjkhtrap 'rm -fr $tmpfiles' 1 2 3 15
7270307Sse
8117260Sachetmpfiles="$tmpfiles xg-c-7.c"
97629Sjkhcat <<EOF > xg-c-7.c
107629Sjkhint
117629Sjkhmain()
127629Sjkh{
137305Sjkh  /* This is a comment which immediately before a keyword.  */
147629Sjkh  gettext ("1");
157629Sjkh
167305Sjkh  // This
177629Sjkh  // one
187629Sjkh  // too
197305Sjkh  // although many blank lines come before the token itself.
207629Sjkh
217629Sjkh      
227629Sjkh
2317279Swosch
2417359Swosch gettext("2");
2553868Syokota
267629Sjkh  /* this one also counts */ gettext ("3");
2729726Swosch
2833274Syokota  gettext("4");
2957693Sjmas
30270307Sse  /* this one is also copied */ nada
3175597Ssobomax  gettext ("5");
3286694Sache
33117260Sache  /* I hope you do not see the following */
347629Sjkh  break;
357629Sjkh  gettext("6");
3642799Syokota
377629Sjkh  /* An unnice
3829726Swosch     multi-line comment */ evil;
39270307Sse  gettext("7");
4075597Ssobomax}
4186694SacheEOF
42117260Sache
437629Sjkhtmpfiles="$tmpfiles xg-c-7.po"
4417695Swosch: ${XGETTEXT=xgettext}
4517695Swosch${XGETTEXT} --omit-header --no-location -c --c++ -d xg-c-7 xg-c-7.c
46194055Sedwintest $? = 0 || { rm -fr $tmpfiles; exit 1; }
4742799Syokota
4817359Swoschtmpfiles="$tmpfiles xg-c-7.ok"
4948663Syokotacat <<EOF > xg-c-7.ok
5053868Syokota#. This is a comment which immediately before a keyword.
51194055Sedwinmsgid "1"
5257693Sjmasmsgstr ""
5357693Sjmas
5448663Syokota#. This
55270307Sse#. one
56270307Sse#. too
57270307Sse#. although many blank lines come before the token itself.
58270307Ssemsgid "2"
5959158Sachemsgstr ""
6033407Syokota
6153868Syokota#. this one also counts
62194055Sedwinmsgid "3"
6333407Syokotamsgstr ""
6442799Syokota
6517359Swoschmsgid "4"
6633407Syokotamsgstr ""
6753868Syokota
68194055Sedwin#. this one is also copied
6933407Syokotamsgid "5"
7042799Syokotamsgstr ""
7133274Syokota
7233407Syokotamsgid "6"
7353868Syokotamsgstr ""
74194055Sedwin
7533407Syokota#. An unnice
7642799Syokota#. multi-line comment
7717359Swoschmsgid "7"
78123682Sachemsgstr ""
79270307SseEOF
80194055Sedwin
81270307Sse: ${DIFF=diff}
82123682Sache${DIFF} xg-c-7.ok xg-c-7.po
83194055Sedwinresult=$?
84123682Sache
85270307Sserm -fr $tmpfiles
86194055Sedwin
87123682Sacheexit $result
8848129Syokota
8953868SyokotaLocal Variables:
90194055Sedwin nuke-trailing-whitespace-p:nil
9153951SyokotaEnd:
9248129Syokota