blob: 480e2ee2451087d4fd8f1069b9141619e5ba6e5e [file] [log] [blame]
RestorerZ96509102024-07-11 21:14:15 +02001source check.vim
2"CheckNotMSWindows
3CheckNotMac
4
5" Test for package translation Makefile
6func Test_gettext_makefile()
7 cd ../po
8 if has('win32')
9 call system('nmake.exe -f Make_mvc.mak "VIMPROG=' .. getenv('VIMPROG') ..
10 \ '" "GETTEXT_PATH=' .. getenv('GETTEXT_PATH') ..
11 \ '" PLUGPACKAGE=test_gettext
12 \ "PO_PLUG_INPUTLIST=..\testdir\test_gettext_makefile_in1.vim
13 \ ..\testdir\test_gettext_makefile_in2.vim
14 \ ..\testdir\test_gettext_makefile_in3.vim
15 \ ..\testdir\test_gettext_makefile_in4.vim" test_gettext.pot')
16 else
17" Will it work on macOS?
18 call system("make -f Makefile PLUGPACKAGE=test_gettext
19 \ PO_PLUG_INPUTLIST=\"../testdir/test_gettext_makefile_in1.vim
20 \ ../testdir/test_gettext_makefile_in2.vim
21 \ ../testdir/test_gettext_makefile_in3.vim
22 \ ../testdir/test_gettext_makefile_in4.vim\" test_gettext.pot")
23 endif
24 let expected = [
25 \ '# SOME DESCRIPTIVE TITLE.',
26 \ '# Copyright (C) YEAR THE PACKAGE''S COPYRIGHT HOLDER',
27 \ '# This file is distributed under the same license as the test_gettext package.',
28 \ '# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.',
29 \ '#',
30 \ '#, fuzzy',
31 \ 'msgid ""',
32 \ 'msgstr ""',
33 \ '"Project-Id-Version: test_gettext\n"',
34 \ '"Report-Msgid-Bugs-To: \n"',
35 \ '"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"',
36 \ '"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"',
37 \ '"Language-Team: LANGUAGE <LL@li.org>\n"',
38 \ '"Language: \n"',
39 \ '"MIME-Version: 1.0\n"',
40 \ '"Content-Type: text/plain; charset=CHARSET\n"',
41 \ '"Content-Transfer-Encoding: 8bit\n"',
42 \ '',
43 \ '#: ../testdir/test_gettext_makefile_in1.vim:4 ../testdir/test_gettext_makefile_in1.vim:6',
44 \ '#: ../testdir/test_gettext_makefile_in2.vim:5 ../testdir/test_gettext_makefile_in4.vim:4',
45 \ 'msgid "This is a test"',
46 \ 'msgstr ""',
47 \ '',
48 \ '#: ../testdir/test_gettext_makefile_in1.vim:5',
49 \ 'msgid "This is another test"',
50 \ 'msgstr ""',
51 \ '',
52 \ '#: ../testdir/test_gettext_makefile_in2.vim:4',
53 \ 'msgid "This is a test from the second file"',
54 \ 'msgstr ""',
55 \ '',
56 \ '#: ../testdir/test_gettext_makefile_in4.vim:5',
57 \ 'msgid "This is a fourth test"',
58 \ 'msgstr ""']
59 let potfile = filter(readfile("test_gettext.pot"), 'v:val !~ "POT-Creation-Date"')
60 call assert_equal(expected, potfile)
61 call delete('test_gettext.pot')
62 cd -
63endfunc
64
65" vim: shiftwidth=2 sts=2 expandtab