diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-06-30 14:17:56 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-06-30 15:18:45 (GMT) |
commit | cd796aa6dcdf83fa50ced56a9885835fda851a09 (patch) | |
tree | 876cbd2764cabcdff820988a1e205547f8be395b /tests/auto/linguist/lupdate/testdata/good/preprocess | |
parent | 11ee32888b1b2370c70708e1385c26dc3a0a367c (diff) | |
download | Qt-cd796aa6dcdf83fa50ced56a9885835fda851a09.zip Qt-cd796aa6dcdf83fa50ced56a9885835fda851a09.tar.gz Qt-cd796aa6dcdf83fa50ced56a9885835fda851a09.tar.bz2 |
integrate linguist tool autotests into the qt testsuite
Task-number: 218935
Diffstat (limited to 'tests/auto/linguist/lupdate/testdata/good/preprocess')
3 files changed, 84 insertions, 0 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/preprocess/main.cpp b/tests/auto/linguist/lupdate/testdata/good/preprocess/main.cpp new file mode 100644 index 0000000..9abfa5e --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/preprocess/main.cpp @@ -0,0 +1,37 @@ +// IMPORTANT!!!! If you want to add testdata to this file, +// always add it to the end in order to not change the linenumbers of translations!!! + + +void func1() { + QApplication::tr("Hello world", "Platform-independent file"); +} + + + + +void func2() { +#ifdef Q_OS_WIN + QApplication::tr("Kind", "Windows only, see Type"); +#else + QApplication::tr("Type", "Not used on windows, see Kind"); +#endif + +} + + + +void stringconcatenation() +{ + QApplication::tr("One string," + " three" + " lines"); + + QApplication::tr("a backslash followed by newline \ +should be ignored \ +and the next line should be syntactically considered to be \ +on the same line"); + +} + + + diff --git a/tests/auto/linguist/lupdate/testdata/good/preprocess/project.pro b/tests/auto/linguist/lupdate/testdata/good/preprocess/project.pro new file mode 100644 index 0000000..012c7e0 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/preprocess/project.pro @@ -0,0 +1,12 @@ +TEMPLATE = app +LANGUAGE = C++ + +SOURCES += main.cpp + +TRANSLATIONS += project.ts + +exists( $$TRANSLATIONS ) { + win32: system(del $$TRANSLATIONS) + unix: system(rm -f $$TRANSLATIONS) +} + diff --git a/tests/auto/linguist/lupdate/testdata/good/preprocess/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/preprocess/project.ts.result new file mode 100644 index 0000000..3aec045 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/preprocess/project.ts.result @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0"> +<context> + <name>QApplication</name> + <message> + <location filename="main.cpp" line="6"/> + <source>Hello world</source> + <comment>Platform-independent file</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="main.cpp" line="14"/> + <source>Kind</source> + <comment>Windows only, see Type</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="main.cpp" line="16"/> + <source>Type</source> + <comment>Not used on windows, see Kind</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="main.cpp" line="25"/> + <source>One string, three lines</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="main.cpp" line="29"/> + <source>a backslash followed by newline should be ignored and the next line should be syntactically considered to be on the same line</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> |